函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_write_relabel

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

返回类型:ssize_t

参数:

类型参数名称
struct file *file
char *buf
size_tsize
965  fsi等于s_fs_info
966  state等于state
967  char * scon = NULL, * tcon = NULL
971  char * newcon = NULL
974  length等于avc_has_perm - Check permissions and perform any appropriate auditing
978  如果length则转到:out
981  length等于负ENOMEM
982  scon等于分配内存并置零
983  如果非scon则转到:out
986  length等于负ENOMEM
987  tcon等于分配内存并置零
988  如果非tcon则转到:out
991  length等于负EINVAL
992  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于3则转到:out
995  length等于security_context_str_to_sid(state, scon, & ssid, GFP_KERNEL)
996  如果length则转到:out
999  length等于security_context_str_to_sid(state, tcon, & tsid, GFP_KERNEL)
1000  如果length则转到:out
1003  length等于security_change_sid(state, ssid, tsid, tclass, & newsid)
1004  如果length则转到:out
1007  length等于security_sid_to_context(state, newsid, & newcon, & len)
1008  如果length则转到:out
1011  length等于负ERANGE
1012  如果len大于SIMPLE_TRANSACTION_LIMIT则转到:out
1015  memcpy(buf, newcon, len)
1016  length等于len
1017  out :
1018  释放内存
1019  释放内存
1020  释放内存
1021  返回:length