Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_socket_sendmsg - Smack check based on destination host*@sock: the socket*@msg: the message*@size: the size of the message* Return 0 if the current subject can write to the destination host.

Proto:static int smack_socket_sendmsg(struct socket *sock, struct msghdr *msg, int size)

Type:int

Parameter:

TypeParameterName
struct socket *sock
struct msghdr *msg
intsize
3666  sip = ptr to socket address structure
3668  sap = ptr to socket address structure
3671  ssp = sk_security
3674  rc = 0
3679  If (sip == NULL) Then Return 0
3683  Case sk_family == Internet IP Protocol
3684  If size of socket address structure < sizeof(structsockaddr_in) || Address family != Internet IP Protocol Then Return -EINVAL
3687  rc = smack_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.
3688  Break
3690  Case sk_family == IP version 6
3691  If size of socket address structure < SIN6_LEN_RFC2133 || AF_INET6 != IP version 6 Then Return -EINVAL
3695  rsp = smack_ipv6host_label - check host based restrictions*@sip: the object end* looks for host based access restrictions* This version will only be appropriate for really small sets of single label* hosts
3696  If (rsp != NULL) Then rc = smk_ipv6_check - check Smack access*@subject: subject Smack label*@object: object Smack label*@address: address*@act: the action being taken* Check an IPv6 access
3701  rc = smk_ipv6_port_check - check Smack port access*@sk: socket*@address: address*@act: the action being taken* Create or update the port list entry
3704  Break
3706  Return rc