Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto: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)

Type:int

Parameter:

TypeParameterName
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  When i < maxfields cycle
190  If bufp > bufendp - sizeof(u32) Then Break
193  len = bufp
197  bufp += sizeof(u32)
200  If bufp > bufendp - len Then Break
203  data = bufp
204  bufp += len
207  If enforce_mask & ENFORCE_FIELDS && i != maxfields Then
208  pr_err("%s: nr of fields mismatch: expected: %d, current: %d\n", bufname, maxfields, i)
210  Return -EINVAL
213  If enforce_mask & ENFORCE_BUFEND && bufp != bufendp Then
214  pr_err("%s: buf end mismatch: expected: %p, current: %p\n", bufname, bufendp, bufp)
216  Return -EINVAL
219  If curfields Then curfields = i
222  If bufcurp Then bufcurp = bufp
225  Return 0
Caller
NameDescribe
ima_restore_measurement_listRestore the serialized binary measurement list without extending PCRs.