Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_netlbl_socket_setsockopt - Do not allow users to remove a NetLabel*@sock: the socket*@level: the socket level or protocol*@optname: the socket option name* Description:* Check the setsockopt() call and if the user is trying to replace the IP*

Proto:int selinux_netlbl_socket_setsockopt(struct socket *sock, int level, int optname)

Type:int

Parameter:

TypeParameterName
struct socket *sock
intlevel
intoptname
505  rc = 0
506  sk = sk
507  sksec = sk_security
510  If selinux_netlbl_option - Is this a NetLabel option*@level: the socket level or protocol*@optname: the socket option name* Description:* Returns true if @level and @optname refer to a NetLabel option.* Helper for selinux_netlbl_socket_setsockopt(). && ( nlbl_state == NLBL_LABELED || nlbl_state == NLBL_CONNLABELED ) Then
513  lbl_secattr_init - Initialize a netlbl_lsm_secattr struct*@secattr: the struct to initialize* Description:* Initialize an already allocated netlbl_lsm_secattr struct.
514  lock_sock(sk)
518  rc = netlbl_sock_getattr(sk, & secattr)
519  release_sock(sk)
520  If rc == 0 Then rc = -EACCES
522  Else if rc == -ENOMSG Then rc = 0
524  lbl_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.
527  Return rc
Caller
NameDescribe
selinux_socket_setsockopt