函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_write_bool

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

返回类型:ssize_t

参数:

类型参数名称
struct file *filep
const char __user *buf
size_tcount
loff_t *ppos
1208  fsi等于s_fs_info
1209  char * page = NULL
1212  index等于Stat data, not accessed from path walking 按位与SEL_INO_MASK
1213  name等于name
1215  如果count大于等于PAGE_SIZE则返回:负ENOMEM
1219  如果ppos不等于0则返回:负EINVAL
1222  page等于memdup_user_nul - duplicate memory region from user space and NUL-terminate*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure.
1223  如果是错误则返回:错误
1226  mutex_lock( & mutex)
1228  length等于avc_has_perm - Check permissions and perform any appropriate auditing
1232  如果length则转到:out
1235  length等于负EINVAL
1236  如果index大于等于bool_num字符串比较则转到:out
1240  length等于负EINVAL
1241  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于1则转到:out
1244  如果new_valuenew_value等于1
1247  bool_pending_values[index]等于new_value
1248  length等于count
1250  out :
1251  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.
1252  释放内存
1253  返回:length