Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_netlabel - Set the secattr on a socket*@sk: the socket*@labeled: socket label scheme* Convert the outbound smack value (smk_out) to a* secattr and attach it to the socket.* Returns 0 on success or an error code

Proto:static int smack_netlabel(struct sock *sk, int labeled)

Type:int

Parameter:

TypeParameterName
struct sock *sk
intlabeled
2411  ssp = sk_security
2412  rc = 0
2422  local_bh_disable()
2423  bh_lock_sock_nested(sk)
2425  If outbound label == smack_net_ambient || labeled == How communications on this socket are treated.* Usually it's determined by the underlying netlabel code* but there are certain cases, including single label hosts* and potentially single label interfaces for which the Then netlbl_sock_delattr(sk)
2428  Else
2429  skp = outbound label
2430  rc = netlbl_sock_setattr(sk, sk_family, & wire labels )
2433  bh_unlock_sock(sk)
2434  local_bh_enable()
2436  Return rc
Caller
NameDescribe
smack_netlabel_sendsmack_netlbel_send - Set the secattr on a socket and perform access checks*@sk: the socket*@sap: the destination address* Set the correct secattr for the given socket based on the destination* address and perform any outbound access checks needed.
smack_inode_setsecuritysmack_inode_setsecurity - set smack xattrs*@inode: the object*@name: attribute name*@value: attribute value*@size: size of the attribute*@flags: unused* Sets the named attribute in the appropriate blob* Returns 0 on success, or an error code
smack_socket_post_createsmack_socket_post_create - finish socket setup*@sock: the socket*@family: protocol family*@type: unused*@protocol: unused*@kern: unused* Sets the netlabel information on the socket* Returns 0 on success, and error code otherwise