函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\match.c Create Date:2022-07-27 21:28:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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)

函数原型:static struct table_header *unpack_table(char *blob, size_t bsize)

返回类型:struct table_header

参数:

类型参数名称
char *blob
size_tbsize
79  struct table_header * table = NULL
83  如果bsize小于sizeof(structtable_header)则转到:out
89  td_id等于be16_to_cpu( * (__be16 * )(blob))减1
90  如果td_id大于YYTD_ID_MAX则转到: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  如果非td_flags恒等于YYTD_DATA16td_flags恒等于YYTD_DATA32td_flags恒等于YYTD_DATA8的值则转到:out
100  tsize等于table_size(td_lolen, td_flags)
101  如果bsize小于tsize则转到:out
104  table等于kvzalloc(tsize, GFP_KERNEL)
105  如果table
106  td_id等于td_id
107  td_flags等于td_flags
108  td_lolen等于td_lolen
109  如果td_flags恒等于YYTD_DATA8UNPACK_ARRAY(td_data, blob, td_lolen, u8, u8, byte_to_byte)
112  否则如果td_flags恒等于YYTD_DATA16UNPACK_ARRAY(td_data, blob, td_lolen, u16, __be16, be16_to_cpu)
115  否则如果td_flags恒等于YYTD_DATA32UNPACK_ARRAY(td_data, blob, td_lolen, u32, __be32, be32_to_cpu)
118  否则转到:fail
123  如果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.vm_unmap_aliases()
127  out :
128  返回: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  返回:NULL
调用者
名称描述
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