Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static int __init ima_add_boot_aggregate(void)

Type:int

Parameter:Nothing

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, size of iint )
58  memset( & hash, 0, size of hash )
59  ima_hash = hdr
60  algo = HASH_ALGO_SHA1
61  length = SHA1_DIGEST_SIZE
63  If ima_tpm_chip Then
64  result = ima_calc_boot_aggregate( & hdr)
65  If result < 0 Then
66  audit_cause = "hashing_error"
67  Go to err_out
71  result = ima_alloc_init_template( & event_data, & entry, NULL)
72  If result < 0 Then
73  audit_cause = "alloc_entry"
74  Go to 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  If result < 0 Then
81  ima_free_template_entry(entry)
82  audit_cause = "store_entry"
83  Go to err_out
85  Return 0
86  err_out :
87  integrity_audit_msg(PCR invalidation msgs , NULL, ame for boot aggregate entry , op, audit_cause, result, 0)
89  Return result
Caller
NameDescribe
ima_init