Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Copy the inode security context value to the user.* Permission check is handled by selinux_inode_getxattr hook.

Proto:static int selinux_inode_getsecurity(struct inode *inode, const char *name, void **buffer, bool alloc)

Type:int

Parameter:

TypeParameterName
struct inode *inode
const char *name
void **buffer
boolalloc
3353  char * context = NULL
3356  If strcmp(name, XATTR_SELINUX_SUFFIX) Then Return -EOPNOTSUPP
3368  isec = Get the security label of an inode.
3369  If has_cap_mac_admin(false) Then error = security_sid_to_context_force( & selinux_state, SID of this object , & context, & size)
3373  Else error = security_sid_to_context( & selinux_state, SID of this object , & context, & size)
3376  If error Then Return error
3378  error = size
3379  If alloc Then
3380  buffer = context
3381  Go to out_nofree
3383  kfree(context)
3384  out_nofree :
3385  Return error
Caller
NameDescribe
selinux_inode_getsecctx