Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sel_write_load

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

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
534  fsi = s_fs_info
536  void * data = NULL
538  mutex_lock( & mutex)
540  length = avc_has_perm - Check permissions and perform any appropriate auditing
543  If length Then Go to out
547  length = -EINVAL
548  If ppos != 0 Then Go to out
551  length = -ENOMEM
552  data = vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags
553  If Not data Then Go to out
556  length = -EFAULT
557  If copy_from_user(data, buf, count) != 0 Then Go to out
560  length = security_load_policy(state, data, count)
561  If length Then
562  pr_warn_ratelimited("SELinux: failed to load policy\n")
563  Go to out
566  length = sel_make_policy_nodes(fsi)
567  If length Then Go to out1
570  length = count
572  out1 :
573  audit_log - Log an audit record*@ctx: audit context*@gfp_mask: type of allocation*@type: audit message type*@fmt: format string to use*@...: variable parameters matching the format string* This is a convenience function that calls audit_log_start,
577  out :
578  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.
579  vfree - release memory allocated by vmalloc()*@addr: memory base address* Free the virtually continuous memory area starting at @addr, as* obtained from vmalloc(), vmalloc_32() or __vmalloc()
580  Return length