函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Add the boot aggregate to the IMA measurement list and extend* the PCR register.* Calculate the boot aggregate, a SHA1 over tpm registers 0-7,* assuming a TPM chip exists, and zeroes if the TPM chip does not* exist

函数原型:static int __init ima_add_boot_aggregate(void)

返回类型:int

参数:

44  op[]等于"add_boot_aggregate"
45  audit_cause等于"ENOMEM"
47  iint等于tmp_iint
48  struct ima_event_data event_data = {iint = iint, filename = ame for boot aggregate entry }
50  result等于负ENOMEM
51  violation等于0
52  struct{struct ima_digest_data hdr;char digest[20];}hash
57  memset(iint, 0, iint的长度)
58  memset( & hash, 0, hash的长度)
59  ima_hash等于hdr
60  algo等于HASH_ALGO_SHA1
61  length等于SHA1_DIGEST_SIZE
63  如果ima_tpm_chip
64  result等于ima_calc_boot_aggregate( & hdr)
65  如果result小于0则
66  audit_cause等于"hashing_error"
67  转到:err_out
71  result等于ima_alloc_init_template( & event_data, & entry, NULL)
72  如果result小于0则
73  audit_cause等于"alloc_entry"
74  转到:err_out
77  result等于ma_store_template - store ima template measurements* Calculate the hash of a template entry, add the template entry* to an ordered list of measurement entries maintained inside the kernel,* and also update the aggregate integrity value (maintained inside
80  如果result小于0则
81  ima_free_template_entry(entry)
82  audit_cause等于"store_entry"
83  转到:err_out
85  返回:0
86  err_out :
87  integrity_audit_msg(PCR invalidation msgs , NULL, ame for boot aggregate entry , op, audit_cause, result, 0)
89  返回:result
调用者
名称描述
ima_init