Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\ima\ima_template_lib.c Create Date:2022-07-28 19:59:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This function writes the digest of an event (with size limit).

Proto:int ima_eventdigest_init(struct ima_event_data *event_data, struct ima_field_data *field_data)

Type:int

Parameter:

TypeParameterName
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, size of hash )
282  If violation Then Go to out
285  If ima_template_hash_algo_allowed(algo) Then
286  cur_digest = digest
287  cur_digestsize = length
288  Go to out
291  If Not file Then Return -EINVAL
294  inode = file_inode(file)
295  algo = If ima_template_hash_algo_allowed(ima_hash_algo) Then ima_hash_algo Else 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  If result Then
299  integrity_audit_msg(Data integrity verification , inode, filename, "collect_data", "failed", result, 0)
302  Return result
304  cur_digest = digest
305  cur_digestsize = length
306  out :
307  Return ima_eventdigest_init_common(cur_digest, cur_digestsize, HASH_ALGO__LAST, field_data)