函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_crypto.c Create Date:2022-07-27 22:00:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ima_calc_file_hash_tfm

函数原型:static int ima_calc_file_hash_tfm(struct file *file, struct ima_digest_data *hash, struct crypto_shash *tfm)

返回类型:int

参数:

类型参数名称
struct file *file
struct ima_digest_data *hash
struct crypto_shash *tfm
335  offset等于0
338  SHASH_DESC_ON_STACK(shash, tfm)
340  tfm等于tfm
342  length等于获得消息文摘大小
344  rc等于rypto_shash_init() - (re)initialize message digest*@desc: operational state handle that is already filled* The call (re-)initializes the message digest referenced by the* operational state handle. Any potentially existing state created by
345  如果rc不等于0则返回:rc
348  i_size等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they
350  如果i_size恒等于0则转到:out
353  rbuf等于分配内存并置零
354  如果非rbuf则返回:负ENOMEM
357 offset小于i_size循环
360  rbuf_len等于grity_kernel_read - read data from the file* This is a function for reading file content instead of kernel_read().* It does not perform locking checks to ensure it cannot be blocked.* It does not perform security checks because it is irrelevant for IMA.
361  如果rbuf_len小于0则
362  rc等于rbuf_len
363  退出
365  如果rbuf_len恒等于0则退出
367  offset加等于rbuf_len
369  rc等于rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
370  如果rc退出
373  释放内存
374  out :
375  如果非rcrc等于rypto_shash_final() - calculate message digest*@desc: operational state handle that is already filled with data*@out: output buffer filled with the message digest* Finalize the message digest operation and create the message digest
377  返回:rc
调用者
名称描述
ima_calc_file_shash