Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ima_restore_template_data

Proto:static int ima_restore_template_data(struct ima_template_desc *template_desc, void *template_data, int template_data_size, struct ima_template_entry **entry)

Type:int

Parameter:

TypeParameterName
struct ima_template_desc *template_desc
void *template_data
inttemplate_data_size
struct ima_template_entry **entry
306  ret = 0
309  entry = 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).
311  If Not entry Then Return -ENOMEM
314  ret = ima_parse_buf(template_data, template_data + template_data_size, NULL, num_fields, template related data , NULL, NULL, ENFORCE_FIELDS | ENFORCE_BUFEND, "template data")
318  If ret < 0 Then
319  kfree( * entry)
320  Return ret
323  template descriptor = template_desc
324  When i < num_fields cycle
325  field_data = template related data [i]
326  data = data
328  data = 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).
330  If Not data Then
331  ret = -ENOMEM
332  Break
334  memcpy(data, data, len)
335  template_data_len += size of len
336  template_data_len += len
339  If ret < 0 Then
340  ma_free_template_entry - free an existing template entry
341  * entry = NULL
344  Return ret
Caller
NameDescribe
ima_restore_measurement_listRestore the serialized binary measurement list without extending PCRs.