函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int ima_store_template(struct ima_template_entry *entry, int violation, struct inode *inode, const unsigned char *filename, int pcr)

返回类型:int

参数:

类型参数名称
struct ima_template_entry *entry
intviolation
struct inode *inode
const unsigned char *filename
intpcr
95  op[]等于"add_template_measure"
96  audit_cause[]等于"hashing_error"
97  template_name等于name
99  struct{struct ima_digest_data hdr;char digest[20];}hash
104  如果非violation
105  num_fields等于num_fields
108  algo等于HASH_ALGO_SHA1
109  result等于ima_calc_field_array_hash( & template related data [0], template descriptor , num_fields, & hdr)
112  如果result小于0则
116  返回:result
118  memcpy( sha1 or md5 measurement hash , digest, length)
120  pcr等于pcr
121  result等于Add template entry to the measurement list and hash table, and* extend the pcr.* On systems which support carrying the IMA measurement list across* kexec, maintain the total memory size required for serializing the* binary_runtime_measurements.
122  返回:result
调用者
名称描述
process_buffer_measurementprocess_buffer_measurement - Measure the buffer to ima log
ima_add_violationma_add_violation - add violation to measurement list.* Violations are flagged in the measurement list with zero hash values.* By extending the PCR with 0xFF's instead of with zeroes, the PCR* value is invalidated.
ima_store_measurementma_store_measurement - store file measurement* Create an "ima" template and then store the template by calling* ima_store_template
ima_add_boot_aggregateAdd 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