Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:smack_socket_getpeersec_stream - pull in packet label*@sock: the socket*@optval: user's destination*@optlen: size thereof*@len: max thereof* returns zero on success, an error code otherwise

Proto:static int smack_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
3961  rcp = ""
3962  slen = 1
3963  rc = 0
3965  ssp = sk_security
3966  If ( TCP peer label != NULL) Then
3967  rcp = smk_known
3968  slen = strlen - Find the length of a string*@s: The string to be sized + 1
3971  If slen > len Then rc = -ERANGE
3973  Else if copy_to_user(optval, rcp, slen) != 0 Then rc = -EFAULT
3976  If Write a simple value into user space(slen, optlen) != 0 Then rc = -EFAULT
3979  Return rc