Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Check if sctp IPv4/IPv6 addresses are valid for binding or connecting* based on their @optname.

Proto:static int selinux_sctp_bind_connect(struct sock *sk, int optname, struct sockaddr *address, int addrlen)

Type:int

Parameter:

TypeParameterName
struct sock *sk
intoptname
struct sockaddr *address
intaddrlen
5276  err = 0 , walk_size = 0
5281  If Not selinux_policycap_extsockclass() Then Return 0
5285  sock = sk_socket
5286  addr_buf = address
5288  When walk_size < addrlen cycle
5289  If walk_size + sizeof(sa_family_t) > addrlen Then Return -EINVAL
5292  addr = addr_buf
5294  Case address family, AF_xxx == Supported address families.
5296  len = sizeof(structsockaddr_in)
5297  Break
5299  len = sizeof(structsockaddr_in6)
5300  Break
5301  Default
5302  Return -EINVAL
5305  If walk_size + len > addrlen Then Return -EINVAL
5308  err = -EINVAL
5311  Case optname == SCTP_PRIMARY_ADDR
5312  Case optname == SCTP_SET_PEER_PRIMARY_ADDR
5315  Break
5317  Case optname == CONNECTX requests.
5318  Case optname == SCTP_PARAM_SET_PRIMARY
5319  Case optname == SCTP_PARAM_ADD_IP
5320  Case optname == SCTP_SENDMSG_CONNECT
5322  If err Then Return err
5337  Break
5340  If err Then Return err
5343  addr_buf += len
5344  walk_size += len
5347  Return 0