函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_write_member

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

返回类型:ssize_t

参数:

类型参数名称
struct file *file
char *buf
size_tsize
1091  fsi等于s_fs_info
1092  state等于state
1093  char * scon = NULL, * tcon = NULL
1097  char * newcon = NULL
1100  length等于avc_has_perm - Check permissions and perform any appropriate auditing
1104  如果length则转到:out
1107  length等于负ENOMEM
1108  scon等于分配内存并置零
1109  如果非scon则转到:out
1112  length等于负ENOMEM
1113  tcon等于分配内存并置零
1114  如果非tcon则转到:out
1117  length等于负EINVAL
1118  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于3则转到:out
1121  length等于security_context_str_to_sid(state, scon, & ssid, GFP_KERNEL)
1122  如果length则转到:out
1125  length等于security_context_str_to_sid(state, tcon, & tsid, GFP_KERNEL)
1126  如果length则转到:out
1129  length等于security_member_sid(state, ssid, tsid, tclass, & newsid)
1130  如果length则转到:out
1133  length等于security_sid_to_context(state, newsid, & newcon, & len)
1134  如果length则转到:out
1137  length等于负ERANGE
1138  如果len大于SIMPLE_TRANSACTION_LIMIT
1139  打印错误信息("SELinux: %s: context size (%u) exceeds payload max\n", __func__, len)
1141  转到:out
1144  memcpy(buf, newcon, len)
1145  length等于len
1146  out :
1147  释放内存
1148  释放内存
1149  释放内存
1150  返回:length