函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:template_desc_init_fields

函数原型:int template_desc_init_fields(const char *template_fmt, const struct ima_template_field ***fields, int *num_fields)

返回类型:int

参数:

类型参数名称
const char *template_fmt
const struct ima_template_field ***fields
int *num_fields
190  如果num_fieldsnum_fields大于0则返回:0
193  template_num_fields等于template_fmt_size(template_fmt)
195  如果template_num_fields大于IMA_TEMPLATE_NUM_FIELDS_MAX
196  打印错误信息("format string '%s' contains too many fields\n", template_fmt)
198  返回:负EINVAL
201 i小于template_num_fields循环
205  len等于strchrnul - Find and return a character in a string, or end of string*@s: The string to be searched*@c: The character to search for* Returns pointer to first occurrence of 'c' in s. If c is not found, thentemplate_fmt_ptr
206  如果len恒等于0或len大于IMA_TEMPLATE_FIELD_ID_MAX_LEN
207  打印错误信息("Invalid field with length %d\n", len)
208  返回:负EINVAL
211  memcpy(tmp_field_id, template_fmt_ptr, len)
212  tmp_field_id[len]等于'\0'
213  found_fields[i]等于lookup_template_field(tmp_field_id)
214  如果非found_fields[i]则
215  打印错误信息("field '%s' not found\n", tmp_field_id)
216  返回:负ENOENT
220  如果fieldsnum_fields
221  fields等于分配数组内存
222  如果( * fields == NULL)则返回:负ENOMEM
225  memcpy( * fields, found_fields, i * fields的长度)
226  num_fields等于i
229  返回:0
调用者
名称描述
ima_parse_rule
ima_template_fmt_setup
ima_init_template
restore_template_fmt
ima_restore_measurement_listRestore the serialized binary measurement list without extending PCRs.