Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\match.c Create Date:2022-07-28 19:51:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pack_table - unpack a dfa table (one of accept, default, base, next check)*@blob: data to unpack (NOT NULL)*@bsize: size of blob* Returns: pointer to table else NULL on failure* NOTE: must be freed by kvfree (not kfree)

Proto:static struct table_header *unpack_table(char *blob, size_t bsize)

Type:struct table_header

Parameter:

TypeParameterName
char *blob
size_tbsize
79  struct table_header * table = NULL
83  If bsize < sizeof(structtable_header) Then Go to out
89  td_id = be16_to_cpu( * (__be16 * )(blob)) - 1
90  If td_id > YYTD_ID_MAX Then Go to out
92  td_flags = be16_to_cpu( * (__be16 * )(blob + 2))
93  td_lolen = be32_to_cpu( * (__be32 * )(blob + 8))
94  blob += sizeof(structtable_header)
96  If Not ( td_flags == YYTD_DATA16 || td_flags == YYTD_DATA32 || td_flags == YYTD_DATA8 ) Then Go to out
100  tsize = table_size(td_lolen, td_flags)
101  If bsize < tsize Then Go to out
104  table = kvzalloc(tsize, GFP_KERNEL)
105  If table Then
106  td_id = td_id
107  td_flags = td_flags
108  td_lolen = td_lolen
109  If td_flags == YYTD_DATA8 Then UNPACK_ARRAY(td_data, blob, td_lolen, u8, u8, byte_to_byte)
112  Else if td_flags == YYTD_DATA16 Then UNPACK_ARRAY(td_data, blob, td_lolen, u16, __be16, be16_to_cpu)
115  Else if td_flags == YYTD_DATA32 Then UNPACK_ARRAY(td_data, blob, td_lolen, u32, __be32, be32_to_cpu)
118  Else Go to fail
123  If Determine if an address is within the vmalloc range* On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there* is no special casing required. Then vm_unmap_aliases()
127  out :
128  Return table
129  fail :
130  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
131  Return NULL
Caller
NameDescribe
aa_dfa_unpackaa_dfa_unpack - unpack the binary tables of a serialized dfa*@blob: aligned serialized stream of data to unpack (NOT NULL)*@size: size of data to unpack*@flags: flags controlling what type of accept tables are acceptable