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:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:smack_socket_connect - connect access check*@sock: the socket*@sap: the other end*@addrlen: size of sap* Verifies that a connection may be possible* Returns 0 on success, and error code otherwise

Proto:static int smack_socket_connect(struct socket *sock, struct sockaddr *sap, int addrlen)

Type:int

Parameter:

TypeParameterName
struct socket *sock
struct sockaddr *sap
intaddrlen
2833  rc = 0
2835  If (sk == NULL) Then Return 0
2837  If sk_family != PF_INET && ( Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_IPV6) || sk_family != PF_INET6 ) Then Return 0
2840  If addrlen < get the member end offset of(structsockaddr, sa_family) Then Return 0
2842  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_IPV6) && address family, AF_xxx == IP version 6 Then
2843  sip = sap
2848  If addrlen < SIN6_LEN_RFC2133 Then Return 0
2851  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
2852  If (rsp != NULL) Then
2853  ssp = sk_security
2860  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
2862  Return rc
2864  If address family, AF_xxx != Internet IP Protocol || addrlen < sizeof(structsockaddr_in) Then Return 0
2866  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.
2867  Return rc