函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:This function writes the digest of an event (with size limit).

函数原型:int ima_eventdigest_init(struct ima_event_data *event_data, struct ima_field_data *field_data)

返回类型:int

参数:

类型参数名称
struct ima_event_data *event_data
struct ima_field_data *field_data
271  struct{struct ima_digest_data hdr;char digest[64];}hash
275  u8 * cur_digest = NULL
276  cur_digestsize等于0
280  memset( & hash, 0, hash的长度)
282  如果violation则转到:out
285  如果ima_template_hash_algo_allowed(algo)则
286  cur_digest等于digest
287  cur_digestsize等于length
288  转到:out
291  如果非file则返回:负EINVAL
294  inode等于file_inode(file)
295  algo等于如果ima_template_hash_algo_allowed(ima_hash_algo)则ima_hash_algo否则HASH_ALGO_SHA1
297  result等于ma_calc_file_hash - calculate file hash* Asynchronous hash (ahash) allows using HW acceleration for calculating* a hash. ahash performance varies for different data sizes on different* crypto accelerators
298  如果result
299  integrity_audit_msg(Data integrity verification , inode, filename, "collect_data", "failed", result, 0)
302  返回:result
304  cur_digest等于digest
305  cur_digestsize等于length
306  out :
307  返回:ima_eventdigest_init_common(cur_digest, cur_digestsize, HASH_ALGO__LAST, field_data)