Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sel_write_context

Proto:static ssize_t sel_write_context(struct file *file, char *buf, size_t size)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
char *buf
size_tsize
590  fsi = s_fs_info
591  state = state
592  char * canon = NULL
596  length = avc_has_perm - Check permissions and perform any appropriate auditing
599  If length Then Go to out
602  length = security_context_to_sid(state, buf, size, & sid, GFP_KERNEL)
603  If length Then Go to out
606  length = security_sid_to_context(state, sid, & canon, & len)
607  If length Then Go to out
610  length = -ERANGE
611  If len > SIMPLE_TRANSACTION_LIMIT Then
612  pr_err("SELinux: %s: context size (%u) exceeds payload max\n", __func__, len)
614  Go to out
617  memcpy(buf, canon, len)
618  length = len
619  out :
620  kfree(canon)
621  Return length