函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-27 20:32:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This supports connect(2) and SCTP connect services such as sctp_connectx(3)* and sctp_sendmsg(3) as described in Documentation/security/SCTP.rst

函数原型:static int selinux_socket_connect_helper(struct socket *sock, struct sockaddr *address, int addrlen)

返回类型:int

参数:

类型参数名称
struct socket *sock
struct sockaddr *address
intaddrlen
4713  sk等于sk
4714  sksec等于sk_security
4717  err等于sock_has_perm(sk, SOCKET__CONNECT)
4718  如果err则返回:err
4720  如果addrlen小于ffsetofend(TYPE, MEMBER)*@TYPE: The type of the structure*@MEMBER: The member within the structure to get the end offset of(structsockaddr, sa_family)则返回:负EINVAL
4726  如果address family, AF_xxx 恒等于Supported address families. 则返回:0
4733  如果 sock security class 恒等于SECCLASS_TCP_SOCKET sock security class 恒等于SECCLASS_DCCP_SOCKET sock security class 恒等于SECCLASS_SCTP_SOCKET
4737  struct lsm_network_audit net = {0, }
4738  struct sockaddr_in * addr4 = NULL
4739  struct sockaddr_in6 * addr6 = NULL
4750  addr4等于address
4751  如果addrlen小于sizeof(structsockaddr_in)则返回:负EINVAL
4753  snum等于ntohs( Port number )
4754  退出
4756  addr6等于address
4757  如果addrlen小于SIN6_LEN_RFC2133则返回:负EINVAL
4760  退出
4761  默认
4765  如果 sock security class 恒等于SECCLASS_SCTP_SOCKET则返回:负EINVAL
4767  否则返回:负EAFNOSUPPORT
4771  err等于sel_netport_sid(sk_protocol, snum, & sid)
4772  如果err则返回:err
4778  退出
4781  退出
4784  退出
4787  type等于LSM_AUDIT_DATA_NET
4788  net等于net
4789  dport等于htons(snum)
4790  family等于address family, AF_xxx
4791  err等于avc_has_perm - Check permissions and perform any appropriate auditing
4793  如果err则返回:err
4797  返回:0
调用者
名称描述
selinux_socket_connectSupports connect(2), see comments in selinux_socket_connect_helper()
selinux_sctp_bind_connectCheck if sctp IPv4/IPv6 addresses are valid for binding or connecting* based on their @optname.