函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-27 20:27:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Check whether a task can link, unlink, or rmdir a file/directory.

函数原型:static int may_link(struct inode *dir, struct dentry *dentry, int kind)

返回类型:int

参数:

类型参数名称
struct inode *dir
struct dentry *dentry
intkind
1864  sid等于get the subjective security ID of the current task
1868  dsec等于Get the security label of an inode.
1869  isec等于Get the security label of a dentry's backing inode.
1871  type等于LSM_AUDIT_DATA_DENTRY
1872  dentry等于dentry
1874  av等于DIR__SEARCH
1875  av或等于如果kindDIR__REMOVE_NAME否则DIR__ADD_NAME
1876  rc等于avc_has_perm - Check permissions and perform any appropriate auditing
1878  如果rc则返回:rc
1882  :kind恒等于MAY_LINK
1883  av等于FILE__LINK
1884  退出
1885  :kind恒等于MAY_UNLINK
1886  av等于FILE__UNLINK
1887  退出
1888  :kind恒等于MAY_RMDIR
1889  av等于DIR__RMDIR
1890  退出
1891  默认
1892  打印警告信息("SELinux: %s: unrecognized kind %d\n", __func__, kind)
1894  返回:0
1897  rc等于avc_has_perm - Check permissions and perform any appropriate auditing
1899  返回:rc
调用者
名称描述
selinux_inode_link
selinux_inode_unlink
selinux_inode_rmdir