Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sel_netport_sid_slow - Lookup the SID of a network address using the policy*@protocol: protocol*@pnum: port*@sid: port SID* Description:* This function determines the SID of a network port by quering the security* policy

Proto:static int sel_netport_sid_slow(u8 protocol, u16 pnum, unsigned int *sid)

Type:int

Parameter:

TypeParameterName
u8protocol
u16pnum
unsigned int *sid
144  spin_lock_bh( & sel_netport_lock)
145  port = sel_netport_find - Search for a port record*@protocol: protocol*@port: pnum* Description:* Search the network port table and return the matching record. If an entry* can not be found in the table return NULL.
146  If (port != NULL) Then
147  sid = SID for this node
148  spin_unlock_bh( & sel_netport_lock)
149  Return 0
152  ret = security_port_sid( & selinux_state, protocol, pnum, sid)
153  If ret != 0 Then Go to out
155  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).
156  If new Then
157  port number = pnum
158  transport protocol = protocol
159  SID for this node = sid
160  sel_netport_insert - Insert a new port into the table*@port: the new port record* Description:* Add a new port record to the network address hash table.
163  out :
164  spin_unlock_bh( & sel_netport_lock)
165  If Value for the false possibility is greater at compile time(ret) Then pr_warn("SELinux: failure in %s(), unable to determine network port label\n", __func__)
168  Return ret
Caller
NameDescribe
sel_netport_sidsel_netport_sid - Lookup the SID of a network port*@protocol: protocol*@pnum: port*@sid: port SID* Description:* This function determines the SID of a network port using the fastest method* possible