Function report |
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 activity | Download SCCT | Chinese |
Name:Restore the serialized binary measurement list without extending PCRs.
Proto:int ima_restore_measurement_list(loff_t size, void *buf)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
loff_t | size | |
void * | buf |
353 | struct ima_field_data hdr[HDR__LAST] = {[HDR_PCR] = {len = sizeof(u32)}, [HDR_DIGEST] = {len = Max TPM v1.2 PCR size }, } |
362 | DECLARE_BITMAP(hdr_mask, HDR__LAST) |
363 | count = 0 |
364 | ret = 0 |
369 | If ima_canonical_fmt Then |
370 | version = le16_to_cpu(version) |
371 | count = le64_to_cpu(count) |
372 | buffer_size = le64_to_cpu(buffer_size) |
375 | If version != 1 Then |
385 | bitmap_zero(hdr_mask, HDR__LAST) |
386 | bitmap_set(hdr_mask, HDR_PCR, 1) |
387 | bitmap_set(hdr_mask, HDR_DIGEST, 1) |
394 | bufendp = buf + buffer_size |
396 | enforce_mask = ENFORCE_FIELDS |
398 | enforce_mask |= If count == count Then ENFORCE_BUFEND Else 0 |
399 | ret = ima_parse_buf(bufp, bufendp, & bufp, HDR__LAST, hdr, NULL, hdr_mask, enforce_mask, "entry header") |
401 | If ret < 0 Then Break |
411 | memcpy(template_name, data, len) |
413 | template_name[len] = 0 |
415 | If strcmp(template_name, "ima") == 0 Then |
416 | pr_err("attempting to restore an unsupported template \"%s\" failed\n", template_name) |
419 | Break |
423 | If Not template_desc Then |
425 | If Not template_desc Then Break |
433 | ret = template_desc_init_fields(fmt, & (fields), & (num_fields)) |
436 | If ret < 0 Then |
440 | Break |
443 | ret = ima_restore_template_data(template_desc, data, len, & entry) |
447 | If ret < 0 Then Break |
450 | memcpy( sha1 or md5 measurement hash , data, len) |
452 | pcr = If Not ima_canonical_fmt Then *data Else le32_to_cpu( * (data)) |
455 | If ret < 0 Then Break |
459 | Return ret |
Name | Describe |
---|---|
ima_load_kexec_buffer | Restore the measurement list from the previous kernel. |
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 |