Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ap_inode_removexattr - Determine whether an xattr may be removed*@dentry: The inode/dentry being altered*@name: The name of the xattr to be changed* Determine whether an xattr may be removed from an inode, returning 0 if

Proto:int cap_inode_removexattr(struct dentry *dentry, const char *name)

Type:int

Parameter:

TypeParameterName
struct dentry *dentry
const char *name
946  user_ns = s_user_ns
949  If strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) != 0 Then Return 0
953  If strcmp(name, XATTR_NAME_CAPS) == 0 Then
955  inode = d_backing_inode - Get upper or lower inode we should be using*@upper: The upper layer* This is the helper that should be used to get at the inode that will be used* if this dentry were to be opened as a file. The inode may be on the upper
956  If Not inode Then Return -EINVAL
958  If Not apable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped*@inode: The inode in question*@cap: The capability in question* Return true if the current task has the given capability targeted at* its own user namespace and that the given inode's Then Return -EPERM
960  Return 0
963  If Not ns_capable(user_ns, Allow setting zone reclaim policy ) Then Return -EPERM
965  Return 0
Caller
NameDescribe
security_inode_removexattr
selinux_inode_removexattr
smack_inode_removexattrsmack_inode_removexattr - Smack check on removexattr*@dentry: the object*@name: name of the attribute* Removing the Smack attribute requires CAP_MAC_ADMIN* Returns 0 if access is permitted, an error code otherwise