Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static int sel_netnode_sid_slow(void *addr, u16 family, unsigned int *sid)

Type:int

Parameter:

TypeParameterName
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  If (node != NULL) Then
199  sid = SID for this node
200  spin_unlock_bh( & sel_netnode_lock)
201  Return 0
204  new = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
206  Case family == PF_INET
207  ret = security_node_sid( & selinux_state, PF_INET, addr, sizeof(structin_addr), sid)
209  If new Then IPv4 node address = addr
211  Break
212  Case family == PF_INET6
213  ret = security_node_sid( & selinux_state, PF_INET6, addr, sizeof(structin6_addr), sid)
215  If new Then IPv6 node address = addr
217  Break
218  Default
219  BUG()
220  ret = -EINVAL
222  If ret == 0 && new Then
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  Else kfree(new)
229  spin_unlock_bh( & sel_netnode_lock)
230  If Value for the false possibility is greater at compile time(ret) Then pr_warn("SELinux: failure in %s(), unable to determine network node label\n", __func__)
233  Return ret
Caller
NameDescribe
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