函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:query_data - queries a policy and writes its data to buf*@buf: the resulting data is stored here (NOT NULL)*@buf_len: size of buf*@query: query string used to retrieve data*@query_len: size of query including second NUL byte

函数原型:static ssize_t query_data(char *buf, size_t buf_len, char *query, size_t query_len)

返回类型:ssize_t

参数:

类型参数名称
char *buf
size_tbuf_len
char *query
size_tquery_len
701  如果非query_len则返回:负EINVAL
704  key等于query字符串长度加1
705  如果key加1大于等于queryquery_len则返回:负EINVAL
707  如果key字符串长度大于等于queryquery_len则返回:负EINVAL
710  如果buf_len小于bytes的长度加blocks的长度则返回:负EINVAL
713  curr等于gin_current_label_crit_section - current's confining label and update it* Returns: up to date confining label or the ns unconfined label (NOT NULL)* Not safe to call inside locks* The returned reference must be put with end_current_label_crit_section()*
714  label等于aa_label_parse(curr, query, GFP_KERNEL, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., false)
715  d_label_crit_section - put a reference found with begin_current_label..*@label: label reference to put* Should only be used with a reference obtained with* begin_current_label_crit_section and never used in situations where the* task cred may be updated
716  如果是错误则返回:错误
727  memset(buf, 0, bytes的长度 + blocks的长度)
728  out等于bufbytes的长度加blocks的长度
730  blocks等于0
732  如果非data则继续下一循环
735  data等于hashtable_lookup_fast - search hash table, without RCU read lock*@ht: hash table*@key: the pointer to the key*@params: hash table parameters* Computes the hash value for the key and traverses the bucket chain looking* for a entry with an identical key
738  如果data
739  如果outoutle32的长度加 size of data in bytes大于bufbuf_len
742  返回:负EINVAL
744  outle32等于__cpu_to_le32( size of data in bytes)
745  memcpy(out, & outle32, outle32的长度)
746  out加等于outle32的长度
747  memcpy(out, binary data, size of data in bytes)
748  out加等于 size of data in bytes
749  blocks自加
752  aa_put_label(label)
754  outle32等于__cpu_to_le32(out - buf - bytes的长度)
755  memcpy(buf, & outle32, outle32的长度)
756  outle32等于__cpu_to_le32(blocks)
757  memcpy(buf + bytes的长度, & outle32, outle32的长度)
759  返回:outbuf
调用者
名称描述
aa_write_accessaa_write_access - generic permissions and data query*@file: pointer to open apparmorfs/access file*@ubuf: user buffer containing the complete query string (NOT NULL)*@count: size of ubuf*@ppos: position in the file (MUST BE ZERO)* Allows for one