Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sel_netif_sid_slow - Lookup the SID of a network interface using the policy*@ns: the network namespace*@ifindex: the network interface*@sid: interface SID* Description:* This function determines the SID of a network interface by quering the

Proto:static int sel_netif_sid_slow(struct net *ns, int ifindex, unsigned int *sid)

Type:int

Parameter:

TypeParameterName
struct net *ns
intifindex
unsigned int *sid
135  ret = 0
143  dev = find a device by its ifindex
144  If Value for the false possibility is greater at compile time(dev == NULL) Then
145  pr_warn("SELinux: failure in %s(), invalid network interface (%d)\n", __func__, ifindex)
147  Return -ENOENT
150  spin_lock_bh( & sel_netif_lock)
151  netif = sel_netif_find - Search for an interface record*@ns: the network namespace*@ifindex: the network interface* Description:* Search the network interface table and return the record matching @ifindex.* If an entry can not be found in the table return NULL.
152  If (netif != NULL) Then
153  sid = SID for this interface
154  Go to out
157  ret = security_netif_sid( & selinux_state, name, sid)
158  If ret != 0 Then Go to out
160  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).
161  If new Then
162  network namespace = ns
163  device index = ifindex
164  SID for this interface = sid
165  If sel_netif_insert - Insert a new interface into the table*@netif: the new interface record* Description:* Add a new interface record to the network interface hash table. Returns* zero on success, negative values on failure. Then kfree(new)
169  out :
170  spin_unlock_bh( & sel_netif_lock)
171  dev_put - release reference to device*@dev: network device* Release reference to device to allow it to be freed.
172  If Value for the false possibility is greater at compile time(ret) Then pr_warn("SELinux: failure in %s(), unable to determine network interface label (%d)\n", __func__, ifindex)
175  Return ret
Caller
NameDescribe
sel_netif_sidsel_netif_sid - Lookup the SID of a network interface*@ns: the network namespace*@ifindex: the network interface*@sid: interface SID* Description:* This function determines the SID of a network interface using the fastest* method possible