Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\selinuxfs.c Create Date:2022-07-28 19:05:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sel_write_bool

Proto:static ssize_t sel_write_bool(struct file *filep, const char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
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  If count >= PAGE_SIZE Then Return -ENOMEM
1219  If ppos != 0 Then Return -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  If IS_ERR(page) Then Return PTR_ERR(page)
1226  mutex_lock( & mutex)
1228  length = avc_has_perm - Check permissions and perform any appropriate auditing
1232  If length Then Go to out
1235  length = -EINVAL
1236  If index >= bool_num || strcmp(name, bool_pending_names[index]) Then Go to out
1240  length = -EINVAL
1241  If sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments != 1 Then Go to out
1244  If new_value Then new_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  kfree(page)
1253  Return length