函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sel_write_validatetrans

函数原型:static ssize_t sel_write_validatetrans(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
681  fsi等于s_fs_info
682  state等于state
683  char * oldcon = NULL, * newcon = NULL, * taskcon = NULL
684  char * req = NULL
689  rc等于avc_has_perm - Check permissions and perform any appropriate auditing
692  如果rc则转到:out
695  rc等于负ENOMEM
696  如果count大于等于PAGE_SIZE则转到:out
700  rc等于负EINVAL
701  如果ppos不等于0则转到:out
704  req等于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.
705  如果是错误
706  rc等于错误
707  req = NULL
708  转到:out
711  rc等于负ENOMEM
712  oldcon等于分配内存并置零
713  如果非oldcon则转到:out
716  newcon等于分配内存并置零
717  如果非newcon则转到:out
720  taskcon等于分配内存并置零
721  如果非taskcon则转到:out
724  rc等于负EINVAL
725  如果sscanf - Unformat a buffer into a list of arguments*@buf: input buffer*@fmt: formatting of buffer*@...: resulting arguments不等于4则转到:out
728  rc等于security_context_str_to_sid(state, oldcon, & osid, GFP_KERNEL)
729  如果rc则转到:out
732  rc等于security_context_str_to_sid(state, newcon, & nsid, GFP_KERNEL)
733  如果rc则转到:out
736  rc等于security_context_str_to_sid(state, taskcon, & tsid, GFP_KERNEL)
737  如果rc则转到:out
740  rc等于security_validate_transition_user(state, osid, nsid, tsid, tclass)
741  如果非rcrc等于count
743  out :
744  释放内存
745  释放内存
746  释放内存
747  释放内存
748  返回:rc