Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namei.c Create Date:2022-07-28 20:05:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:generic_permission - check for access rights on a Posix-like filesystem*@inode: inode to check access rights for*@mask: right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC,

Proto:int generic_permission(struct inode *inode, int mask)

Type:int

Parameter:

TypeParameterName
struct inode *inode
intmask
339  ret = This does the basic permission checking
340  If ret != -EACCES Then Return ret
343  If S_ISDIR(i_mode) Then
345  If Not (mask & MAY_WRITE) Then If 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
348  Return 0
349  If 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 0
351  Return -EACCES
357  mask &= MAY_READ | MAY_WRITE | MAY_EXEC
358  If mask == MAY_READ Then If 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
360  Return 0
366  If Not (mask & MAY_EXEC) || i_mode & S_IXUGO Then If 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
368  Return 0
370  Return -EACCES
Caller
NameDescribe
do_inode_permissionWe _really_ want to just do "generic_permission()" without* even looking at the inode->i_op values. So we keep a cache* flag in inode->i_opflags, that says "this has not special* permission function, use the fast case".