函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:selinux_socket_getpeersec_stream

函数原型:static int selinux_socket_getpeersec_stream(struct socket *sock, char __user *optval, int __user *optlen, unsigned len)

返回类型:int

参数:

类型参数名称
struct socket *sock
char __user *optval
int __user *optlen
unsignedlen
5074  err等于0
5077  sksec等于sk_security
5078  peer_sid等于unspecified SID
5080  如果 sock security class 恒等于SECCLASS_UNIX_STREAM_SOCKET sock security class 恒等于SECCLASS_TCP_SOCKET sock security class 恒等于SECCLASS_SCTP_SOCKETpeer_sid等于 SID of peer
5084  如果peer_sid恒等于unspecified SID 则返回:负ENOPROTOOPT
5087  err等于security_sid_to_context( & selinux_state, peer_sid, & scontext, & scontext_len)
5089  如果err则返回:err
5092  如果scontext_len大于len
5093  err等于负ERANGE
5094  转到:out_len
5097  如果copy_to_user(optval, scontext, scontext_len)则err等于负EFAULT
5100  out_len :
5101  如果put_user - Write a simple value into user space(scontext_len, optlen)则err等于负EFAULT
5103  释放内存
5104  返回:err