函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:proc_setgroups_write

函数原型:ssize_t proc_setgroups_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
1136  seq等于 needed for tty driver, and maybe others
1137  ns等于private
1143  ret等于负EINVAL
1144  如果ppos不等于0或count大于等于kbuf的长度则转到:out
1148  ret等于负EFAULT
1149  如果copy_from_user(kbuf, buf, count)则转到:out
1151  kbuf[count]等于'\0'
1152  pos等于kbuf
1155  ret等于负EINVAL
1156  如果字符串指定长度比较恒等于0则
1157  pos加等于5
1158  setgroups_allowed = true
1160  否则如果字符串指定长度比较恒等于0则
1161  pos加等于4
1162  setgroups_allowed = false
1164  否则转到:out
1168  pos等于字符串删除空格
1169  如果pos不等于'\0'则转到:out
1172  ret等于负EPERM
1173  mutex_lock( & userns_state_mutex)
1174  如果setgroups_allowed
1178  如果非flags按位与USERNS_SETGROUPS_ALLOWED的值则转到:out_unlock
1180  否则
1184  如果 64 bytes -- 1 cache line 不等于0则转到:out_unlock
1186  flags与等于USERNS_SETGROUPS_ALLOWED的反
1188  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1191  ppos等于count
1192  ret等于count
1193  out :
1194  返回:ret
1195  out_unlock :
1196  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1197  转到:out