函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\xattr.c Create Date:2022-07-29 10:40:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Check permissions for extended attribute access. This is a bit complicated* because different namespaces have very different rules.

函数原型:static int xattr_permission(struct inode *inode, const char *name, int mask)

返回类型:int

参数:

类型参数名称
struct inode *inode
const char *name
intmask
92  如果mask按位与MAY_WRITE
93  如果IS_IMMUTABLE(inode)或IS_APPEND(inode)则返回:负EPERM
100  如果HAS_UNMAPPED_ID(inode)则返回:负EPERM
108  如果非字符串指定长度比较或非字符串指定长度比较则返回:0
115  如果非字符串指定长度比较
116  如果非操作权限检查则返回:如果mask按位与MAY_WRITE则负EPERM否则负ENODATA
118  返回:0
126  如果非字符串指定长度比较
127  如果非S_ISREG(i_mode)且非S_ISDIR(i_mode)则返回:如果mask按位与MAY_WRITE则负EPERM否则负ENODATA
129  如果S_ISDIR(i_mode)且i_mode按位与S_ISVTXmask按位与MAY_WRITE且非de_owner_or_capable - check current task permissions to inode*@inode: inode being checked* Return true if current either has CAP_FOWNER in a namespace with the* inode owner uid mapped, or owns the file.则返回:负EPERM
134  返回:de_permission - Check for access rights to a given inode*@inode: Inode to check permission on*@mask: Right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC)* Check for read/write/execute permissions on an inode
调用者
名称描述
vfs_setxattr
vfs_getxattr_allocvfs_getxattr_alloc - allocate memory, if necessary, before calling getxattr* Allocate memory, if not already allocated, or re-allocate correct size,* before retrieving the extended attribute.
vfs_getxattr
vfs_removexattr