函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:selinux_netlbl_skbuff_setsid - Set the NetLabel on a packet given a sid*@skb: the packet*@family: protocol family*@sid: the SID* Description* Call the NetLabel mechanism to set the label of a packet using @sid.

函数原型:int selinux_netlbl_skbuff_setsid(struct sk_buff *skb, u16 family, unsigned int sid)

返回类型:int

参数:

类型参数名称
struct sk_buff *skb
u16family
unsigned intsid
231  struct netlbl_lsm_secattr * secattr = NULL
236  sk等于skb_to_full_sk(skb)
237  如果(sk != NULL)则
238  sksec等于sk_security
240  如果nlbl_state不等于NLBL_REQSKB则返回:0
242  secattr等于selinux_netlbl_sock_getattr - Get the cached NetLabel secattr*@sk: the socket*@sid: the SID* Query the socket's cached secattr and if the SID matches the cached value* return the cache, otherwise return NULL.
244  如果(secattr == NULL)则
245  secattr等于secattr_storage
246  lbl_secattr_init - Initialize a netlbl_lsm_secattr struct*@secattr: the struct to initialize* Description:* Initialize an already allocated netlbl_lsm_secattr struct.
247  rc等于security_netlbl_sid_to_secattr( & selinux_state, sid, secattr)
249  如果rc不等于0则转到:skbuff_setsid_return
253  rc等于netlbl_skbuff_setattr(skb, family, secattr)
255  skbuff_setsid_return :
256  如果secattr恒等于secattr_storagelbl_secattr_destroy - Clears a netlbl_lsm_secattr struct*@secattr: the struct to clear* Description:* Destroys the @secattr struct, including freeing all of the internal buffers.* The struct must be reset with a call to netlbl_secattr_init() before reuse.
258  返回:rc