函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags)

返回类型:struct aa_dfa

参数:

类型参数名称
void *blob
size_tsize
intflags
284  error等于负ENOMEM
285  data等于blob
286  struct table_header * table = NULL
287  dfa等于分配内存并置零
288  如果非dfa则转到:fail
291  初始化对象
293  error等于负EPROTO
296  如果size小于sizeof(structtable_set_header)则转到:fail
299  如果ntohl( * (__be32 * )data)不等于The format used for transition tables is based on the GNU flex table* file format (--tables-file option; see Table File Format in the flex* info pages and the flex sources for documentation)则转到:fail
302  hsize等于ntohl( * (__be32 * )(data + 4))
303  如果size小于hsize则转到:fail
306  flags等于ntohs( * (__be16 * )(data + 12))
307  如果flags不等于0且flags不等于YYTH_FLAG_DIFF_ENCODE则转到:fail
310  data加等于hsize
311  size减等于hsize
313 size大于0循环
314  table等于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)
315  如果非table则转到:fail
322  退出
323  :td_id恒等于YYTD_ID_ACCEPT2
324  如果非td_flags按位与ACCEPT2_FLAGS(flags)的值则转到:fail
326  退出
327  :td_id恒等于YYTD_ID_BASE
328  如果td_flags不等于YYTD_DATA32则转到:fail
330  退出
331  :td_id恒等于YYTD_ID_DEF
332  :td_id恒等于YYTD_ID_NXT
333  :td_id恒等于YYTD_ID_CHK
334  如果td_flags不等于YYTD_DATA16则转到:fail
336  退出
337  :td_id恒等于YYTD_ID_EC
338  如果td_flags不等于YYTD_DATA8则转到:fail
340  退出
341  默认
342  转到:fail
345  如果tables[td_id]则转到:fail
347  tables[td_id]等于table
348  data加等于table_size(td_lolen, td_flags)
349  size减等于table_size(td_lolen, td_flags)
350  table = NULL
352  error等于verify_table_headers - verify that the tables headers are as expected*@tables - array of dfa tables to check (NOT NULL)*@flags: flags controlling what type of accept table are acceptable* Assumes dfa has gone through the first pass verification done by
353  如果error则转到:fail
356  如果flags按位与DFA_FLAG_VERIFY_STATES
357  error等于verify_dfa - verify that transitions and states in the tables are in bounds
358  如果error则转到:fail
362  返回:dfa
364  fail :
365  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.
366  dfa_free - free a dfa allocated by aa_dfa_unpack*@dfa: the dfa to free (MAYBE NULL)* Requires: reference count to dfa == 0
367  返回:错误号
调用者
名称描述
aa_setup_dfa_engine
unpack_dfapack_dfa - unpack a file rule dfa*@e: serialized data extent information (NOT NULL)* returns dfa or ERR_PTR or NULL if no dfa