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:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ima_write_template_field_data

Proto:static int ima_write_template_field_data(const void *data, const unsigned int datalen, enum data_formats datafmt, struct ima_field_data *field_data)

Type:int

Parameter:

TypeParameterName
const void *data
const unsigned intdatalen
enum data_formatsdatafmt
struct ima_field_data *field_data
36  buflen = datalen
38  If datafmt == DATA_FMT_STRING Then buflen = datalen + 1
41  buf = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
42  If Not buf Then Return -ENOMEM
45  memcpy(buf, data, datalen)
54  If datafmt == DATA_FMT_STRING Then
55  When buf_ptr - buf < datalen cycle If buf_ptr == ' ' Then
57  buf_ptr = '_'
60  data = buf
61  len = buflen
62  Return 0
Caller
NameDescribe
ima_eventdigest_init_common
ima_eventname_init_common
ima_eventsig_initma_eventsig_init - include the file signature as part of the template data
ima_eventbuf_initma_eventbuf_init - include the buffer(kexec-cmldine) as part of the* template data.
ima_eventmodsig_initma_eventmodsig_init - include the appended file signature as part of the* template data