函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:selinux_setprocattr

函数原型:static int selinux_setprocattr(const char *name, void *value, size_t size)

返回类型:int

参数:

类型参数名称
const char *name
void *value
size_tsize
6336  mysid等于get the subjective security ID of the current task, sid等于0
6338  str等于value
6343  如果非字符串比较error等于avc_has_perm - Check permissions and perform any appropriate auditing
6347  否则如果非字符串比较error等于avc_has_perm - Check permissions and perform any appropriate auditing
6351  否则如果非字符串比较error等于avc_has_perm - Check permissions and perform any appropriate auditing
6355  否则如果非字符串比较error等于avc_has_perm - Check permissions and perform any appropriate auditing
6359  否则如果非字符串比较error等于avc_has_perm - Check permissions and perform any appropriate auditing
6363  否则error等于负EINVAL
6365  如果error则返回:error
6369  如果sizestr[0]且str[0]不等于'\n'则
6370  如果str[size - 1]恒等于'\n'则
6371  str[size - 1]等于0
6372  size自减
6374  error等于security_context_to_sid( & selinux_state, value, size, & sid, GFP_KERNEL)
6376  如果error恒等于负EINVAL且非字符串比较
6377  如果非has_cap_mac_admin(true)则
6400  如果error则返回:error
6404  new等于prepare_creds - Prepare a new set of credentials for modification* Prepare a new set of task credentials for modification
6405  如果非new则返回:负ENOMEM
6414  tsec等于selinux_cred(new)
6415  如果非字符串比较
6416  exec SID 等于sid
6417  否则如果非字符串比较
6418  fscreate SID 等于sid
6419  否则如果非字符串比较
6420  如果sid
6423  如果error则转到:abort_change
6426  keycreate SID 等于sid
6427  否则如果非字符串比较
6428  fscreate SID 等于sid
6429  否则如果非字符串比较
6430  error等于负EINVAL
6431  如果sid恒等于0则转到:abort_change
6435  error等于负EPERM
6439  如果error则转到:abort_change
6444  error等于avc_has_perm - Check permissions and perform any appropriate auditing
6447  如果error则转到:abort_change
6452  ptsid等于prm security operations
6453  如果ptsid不等于0则
6457  如果error则转到:abort_change
6461  current SID 等于sid
6462  否则
6463  error等于负EINVAL
6464  转到:abort_change
6467  mmit_creds - Install new credentials upon the current task*@new: The credentials to be assigned* Install a new set of credentials to the current task, using RCU to replace* the old set. Both the objective and the subjective credentials pointers are
6468  返回:size
6470  abort_change :
6471  abort_creds - Discard a set of credentials and unlock the current task*@new: The credentials that were going to be applied* Discard a set of credentials that were under construction and unlock the* current task.
6472  返回:error