函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_netnode_sid_slow - Lookup the SID of a network address using the policy*@addr: the IP address*@family: the address family*@sid: node SID* Description:* This function determines the SID of a network address by quering the* security policy

函数原型:static int sel_netnode_sid_slow(void *addr, u16 family, unsigned int *sid)

返回类型:int

参数:

类型参数名称
void *addr
u16family
unsigned int *sid
196  spin_lock_bh( & sel_netnode_lock)
197  node等于sel_netnode_find - Search for a node record*@addr: IP address*@family: address family* Description:* Search the network node table and return the record matching @addr. If an* entry can not be found in the table return NULL.
198  如果(node != NULL)则
199  sid等于 SID for this node
200  spin_unlock_bh( & sel_netnode_lock)
201  返回:0
204  new等于分配内存并置零
206  :family恒等于PF_INET
207  ret等于security_node_sid( & selinux_state, PF_INET, addr, sizeof(structin_addr), sid)
209  如果new IPv4 node address 等于addr
211  退出
212  :family恒等于PF_INET6
213  ret等于security_node_sid( & selinux_state, PF_INET6, addr, sizeof(structin6_addr), sid)
215  如果new IPv6 node address 等于addr
217  退出
218  默认
219  BUG()
220  ret等于负EINVAL
222  如果ret恒等于0且new
223  address family 等于family
224  SID for this node 等于sid
225  sel_netnode_insert - Insert a new node into the table*@node: the new node record* Description:* Add a new node record to the network address hash table.
226  否则释放内存
229  spin_unlock_bh( & sel_netnode_lock)
230  如果此条件成立可能性小(为编译器优化)(ret)则打印警告信息("SELinux: failure in %s(), unable to determine network node label\n", __func__)
233  返回:ret
调用者
名称描述
sel_netnode_sidsel_netnode_sid - Lookup the SID of a network address*@addr: the IP address*@family: the address family*@sid: node SID* Description:* This function determines the SID of a network address using the fastest* method possible