Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static struct netlbl_lsm_secattr *selinux_netlbl_sock_genattr(struct sock *sk)

Type:struct netlbl_lsm_secattr

Parameter:

TypeParameterName
struct sock *sk
70  sksec = sk_security
73  If ( NetLabel sec attributes != NULL) Then Return NetLabel sec attributes
76  secattr = lbl_secattr_alloc - Allocate and initialize a netlbl_lsm_secattr struct*@flags: the memory allocation flags* Description:* Allocate and initialize a netlbl_lsm_secattr struct. Returns a valid* pointer on success, or NULL on failure.
77  If (secattr == NULL) Then Return NULL
79  rc = security_netlbl_sid_to_secattr( & selinux_state, SID of this object , secattr)
81  If rc != 0 Then
82  lbl_secattr_free - Frees a netlbl_lsm_secattr struct*@secattr: the struct to free* Description:* Frees @secattr including all of the internal buffers.
83  Return NULL
85  NetLabel sec attributes = secattr
87  Return secattr
Caller
NameDescribe
selinux_netlbl_socket_post_createselinux_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
selinux_netlbl_socket_connect_helperselinux_netlbl_socket_connect_helper - Help label a client-side socket on* connect*@sk: the socket to label*@addr: the destination address* Description:* Attempt to label a connected socket with NetLabel using the given address.