函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_write_user

函数原型:static ssize_t sel_write_user(struct file *file, char *buf, size_t size)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
char *buf
size_tsize
1026  fsi等于s_fs_info
1027  state等于state
1028  con等于NULL, user等于NULL
1029  unsigned int sid, * sids = NULL
1035  length等于avc_has_perm - Check permissions and perform any appropriate auditing
1039  如果length则转到:out
1042  length等于负ENOMEM
1043  con等于分配内存并置零
1044  如果非con则转到:out
1047  length等于负ENOMEM
1048  user等于分配内存并置零
1049  如果非user则转到:out
1052  length等于负EINVAL
1053  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于2则转到:out
1056  length等于security_context_str_to_sid(state, con, & sid, GFP_KERNEL)
1057  如果length则转到:out
1060  length等于security_get_user_sids(state, sid, user, & sids, & nsids)
1061  如果length则转到:out
1064  length等于输出格式化串加1
1065  ptr等于buflength
1066 i小于nsids循环
1067  rc等于security_sid_to_context(state, sids[i], & newcon, & len)
1068  如果rc
1069  length等于rc
1070  转到:out
1072  如果lengthlen大于等于SIMPLE_TRANSACTION_LIMIT
1073  释放内存
1074  length等于负ERANGE
1075  转到:out
1077  memcpy(ptr, newcon, len)
1078  释放内存
1079  ptr加等于len
1080  length加等于len
1082  out :
1083  释放内存
1084  释放内存
1085  释放内存
1086  返回:length