函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:apparmor_socket_getpeersec_stream - get security context of peer* Note: for tcp only valid if using ipsec or cipso on lan

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

返回类型:int

参数:

类型参数名称
struct socket *sock
char __user *optval
int __user *optlen
unsigned intlen
1073  error等于0
1077  label等于gin_current_label_crit_section - current's confining label and update it* Returns: up to date confining label or the ns unconfined label (NOT NULL)* Not safe to call inside locks* The returned reference must be put with end_current_label_crit_section()*
1078  peer等于sk_peer_label(sk)
1079  如果是错误
1080  error等于错误
1081  转到:done
1083  slen等于aa_label_asxprint( & name, labels_ns(label), peer, FLAG_SHOW_MODE | FLAG_VIEW_SUBNS | FLAG_HIDDEN_UNCONFINED, GFP_KERNEL)
1087  如果slen小于0则
1088  error等于负ENOMEM
1089  否则
1090  如果slen大于len
1091  error等于负ERANGE
1092  否则如果copy_to_user(optval, name, slen)则
1093  error等于负EFAULT
1094  转到:out
1096  如果put_user - Write a simple value into user space(slen, optlen)则error等于负EFAULT
1098  out :
1099  释放内存
1103  done :
1104  d_label_crit_section - put a reference found with begin_current_label..*@label: label reference to put* Should only be used with a reference obtained with* begin_current_label_crit_section and never used in situations where the* task cred may be updated
1106  返回:error