函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ma_parse_buf() - Parses lengths and data from an input buffer*@bufstartp: Buffer start address.*@bufendp: Buffer end address.*@bufcurp: Pointer to remaining (non-parsed) data.*@maxfields: Length of fields array.

函数原型:int ima_parse_buf(void *bufstartp, void *bufendp, void **bufcurp, int maxfields, struct ima_field_data *fields, int *curfields, unsigned long *len_mask, int enforce_mask, char *bufname)

返回类型:int

参数:

类型参数名称
void *bufstartp
void *bufendp
void **bufcurp
intmaxfields
struct ima_field_data *fields
int *curfields
unsigned long *len_mask
intenforce_mask
char *bufname
185  bufp等于bufstartp
188 i小于maxfields循环
190  如果bufp大于bufendpsizeof(u32)则退出
193  len等于bufp
194  如果ima_canonical_fmtlen等于le32_to_cpu(len)
197  bufp加等于sizeof(u32)
200  如果bufp大于bufendplen退出
203  data等于bufp
204  bufp加等于len
207  如果enforce_mask按位与ENFORCE_FIELDSi不等于maxfields
208  打印错误信息("%s: nr of fields mismatch: expected: %d, current: %d\n", bufname, maxfields, i)
210  返回:负EINVAL
213  如果enforce_mask按位与ENFORCE_BUFENDbufp不等于bufendp
214  打印错误信息("%s: buf end mismatch: expected: %p, current: %p\n", bufname, bufendp, bufp)
216  返回:负EINVAL
219  如果curfieldscurfields等于i
222  如果bufcurpbufcurp等于bufp
225  返回:0
调用者
名称描述
ima_restore_measurement_listRestore the serialized binary measurement list without extending PCRs.