Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:selinux_socket_getpeersec_stream

Proto:static int selinux_socket_getpeersec_stream(struct socket *sock, char __user *optval, int __user *optlen, unsigned len)

Type:int

Parameter:

TypeParameterName
struct socket *sock
char __user *optval
int __user *optlen
unsignedlen
5074  err = 0
5077  sksec = sk_security
5078  peer_sid = unspecified SID
5080  If sock security class == SECCLASS_UNIX_STREAM_SOCKET || sock security class == SECCLASS_TCP_SOCKET || sock security class == SECCLASS_SCTP_SOCKET Then peer_sid = SID of peer
5084  If peer_sid == unspecified SID Then Return -ENOPROTOOPT
5087  err = security_sid_to_context( & selinux_state, peer_sid, & scontext, & scontext_len)
5089  If err Then Return err
5092  If scontext_len > len Then
5093  err = -ERANGE
5094  Go to out_len
5097  If copy_to_user(optval, scontext, scontext_len) Then err = -EFAULT
5100  out_len :
5101  If Write a simple value into user space(scontext_len, optlen) Then err = -EFAULT
5103  kfree(scontext)
5104  Return err