Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ma_store_measurement - store file measurement* Create an "ima" template and then store the template by calling* ima_store_template

Proto:void ima_store_measurement(struct integrity_iint_cache *iint, struct file *file, const unsigned char *filename, struct evm_ima_xattr_data *xattr_value, int xattr_len, const struct modsig *modsig, int pcr, struct ima_template_desc *template_desc)

Type:void

Parameter:

TypeParameterName
struct integrity_iint_cache *iint
struct file *file
const unsigned char *filename
struct evm_ima_xattr_data *xattr_value
intxattr_len
const struct modsig *modsig
intpcr
struct ima_template_desc *template_desc
299  op[] = "add_template_measure"
300  audit_cause[] = "ENOMEM"
301  result = -ENOMEM
302  inode = file_inode(file)
304  struct ima_event_data event_data = {iint = iint, file = file, filename = filename, xattr_value = xattr_value, xattr_len = xattr_len, modsig = modsig}
310  violation = 0
318  If measured_pcrs & 0x1 << pcr && Not modsig Then Return
321  result = ma_alloc_init_template - create and initialize a new template entry
322  If result < 0 Then
323  integrity_audit_msg(PCR invalidation msgs , inode, filename, op, audit_cause, result, 0)
325  Return
328  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
329  If ( Not result || result == -EEXIST ) && Not (f_flags & O_DIRECT) Then
330  flags |= IMA_MEASURED
331  measured_pcrs |= 0x1 << pcr
333  If result < 0 Then ma_free_template_entry - free an existing template entry
Caller
NameDescribe
process_measurement