函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:may_linkat - Check permissions for creating a hardlink*@link: the source to hardlink from* Block hardlink when all of:* - sysctl_protected_hardlinks enabled* - fsuid does not match inode* - hardlink source is unsafe (see safe_hardlink_source() above)* -

函数原型:static int may_linkat(struct path *link)

返回类型:int

参数:

类型参数名称
struct path *link
981  inode等于 Where the name belongs to - NULL is * negative
984  如果非uid_valid(i_uid)或非gid_valid(i_gid)则返回:负EOVERFLOW
987  如果非sysctl_protected_hardlinks则返回:0
993  如果safe_hardlink_source - Check for safe hardlink conditions*@inode: the source inode to hardlink from* Return false if at least one of the following conditions:* - inode is not a regular file* - inode is setuid* - inode is setgid and group-exec* - access inode_owner_or_capable(inode)则返回:0
996  audit_log_path_denied - report a path restriction denial*@type: audit message type (AUDIT_ANOM_LINK, AUDIT_ANOM_CREAT, etc)*@operation: specific operation name
997  返回:负EPERM
调用者
名称描述
do_linkatHardlinks are often used in delicate situations. We avoid* security-related surprises by not following symlinks on the* newname. --KAB* We don't follow them on the oldname either to be compatible* with linux 2.0, and to avoid hard-linking to directories