Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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)* -

Proto:static int may_linkat(struct path *link)

Type:int

Parameter:

TypeParameterName
struct path *link
981  inode = Where the name belongs to - NULL is * negative
984  If Not uid_valid(i_uid) || Not gid_valid(i_gid) Then Return -EOVERFLOW
987  If Not sysctl_protected_hardlinks Then Return 0
993  If 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) Then Return 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  Return -EPERM
Caller
NameDescribe
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