函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_write_load

函数原型:static ssize_t sel_write_load(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
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  如果length则转到:out
547  length等于负EINVAL
548  如果ppos不等于0则转到: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  如果非data则转到:out
556  length等于负EFAULT
557  如果copy_from_user(data, buf, count)不等于0则转到:out
560  length等于security_load_policy(state, data, count)
561  如果length
562  pr_warn_ratelimited("SELinux: failed to load policy\n")
563  转到:out
566  length等于sel_make_policy_nodes(fsi)
567  如果length则转到: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  返回:length