Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_netlbl_socket_post_create - Label a socket using NetLabel*@sock: the socket to label*@family: protocol family* Description:* Attempt to label a socket using the NetLabel mechanism using the given* SID

Proto:int selinux_netlbl_socket_post_create(struct sock *sk, u16 family)

Type:int

Parameter:

TypeParameterName
struct sock *sk
u16family
392  sksec = sk_security
395  If family != PF_INET && family != PF_INET6 Then Return 0
398  secattr = selinux_netlbl_sock_genattr - Generate the NetLabel socket secattr*@sk: the socket* Description:* Generate the NetLabel security attributes for a socket, making full use of* the socket's attribute cache. Returns a pointer to the security attributes
399  If (secattr == NULL) Then Return -ENOMEM
401  rc = netlbl_sock_setattr(sk, family, secattr)
403  Case rc == 0
404  nlbl_state = NLBL_LABELED
405  Break
406  Case rc == -EDESTADDRREQ
407  nlbl_state = NLBL_REQSKB
408  rc = 0
409  Break
412  Return rc