Function report |
Source Code:security\integrity\ima\ima_template.c |
Create Date:2022-07-28 19:59:10 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:template_desc_init_fields
Proto:int template_desc_init_fields(const char *template_fmt, const struct ima_template_field ***fields, int *num_fields)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| const char * | template_fmt | |
| const struct ima_template_field *** | fields | |
| int * | num_fields |
| 190 | If num_fields && num_fields > 0 Then Return 0 |
| 195 | If template_num_fields > IMA_TEMPLATE_NUM_FIELDS_MAX Then |
| 196 | pr_err("format string '%s' contains too many fields\n", template_fmt) |
| 198 | Return -EINVAL |
| 201 | When i < template_num_fields cycle |
| 206 | If len == 0 || len > IMA_TEMPLATE_FIELD_ID_MAX_LEN Then |
| 211 | memcpy(tmp_field_id, template_fmt_ptr, len) |
| 212 | tmp_field_id[len] = '\0' |
| 214 | If Not found_fields[i] Then |
| 215 | pr_err("field '%s' not found\n", tmp_field_id) |
| 216 | Return -ENOENT |
| 220 | If fields && num_fields Then |
| 221 | fields = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
| 225 | memcpy( * fields, found_fields, i * size of fields ) |
| 226 | num_fields = i |
| 229 | Return 0 |
| Name | Describe |
|---|---|
| ima_parse_rule | |
| ima_template_fmt_setup | |
| ima_init_template | |
| restore_template_fmt | |
| ima_restore_measurement_list | Restore the serialized binary measurement list without extending PCRs. |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |