函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:static int sel_netif_sid_slow(struct net *ns, int ifindex, unsigned int *sid)

返回类型:int

参数:

类型参数名称
struct net *ns
intifindex
unsigned int *sid
135  ret等于0
143  dev等于通过接口索引号找设备
144  如果此条件成立可能性小(为编译器优化)(dev == NULL)则
145  打印警告信息("SELinux: failure in %s(), invalid network interface (%d)\n", __func__, ifindex)
147  返回:负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  如果(netif != NULL)则
153  sid等于 SID for this interface
154  转到:out
157  ret等于security_netif_sid( & selinux_state, name, sid)
158  如果ret不等于0则转到:out
160  new等于分配内存并置零
161  如果new
162  network namespace 等于ns
163  device index 等于ifindex
164  SID for this interface 等于sid
165  如果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.释放内存
169  out :
170  spin_unlock_bh( & sel_netif_lock)
171  发布参考设备
172  如果此条件成立可能性小(为编译器优化)(ret)则打印警告信息("SELinux: failure in %s(), unable to determine network interface label (%d)\n", __func__, ifindex)
175  返回:ret
调用者
名称描述
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