函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Hardlinks 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

函数原型:int do_linkat(int olddfd, const char __user *oldname, int newdfd, const char __user *newname, int flags)

返回类型:int

参数:

类型参数名称
intolddfd
const char __user *oldname
intnewdfd
const char __user *newname
intflags
4213  struct inode * delegated_inode = NULL
4214  how等于0
4217  如果flags按位与Follow symbolic links. 按位或Allow empty relative pathname 的值的反的值不等于0则返回:负EINVAL
4224  如果flags按位与Allow empty relative pathname
4225  如果非操作权限检查则返回:负ENOENT
4227  how等于accept empty path [user_... only]
4230  如果flags按位与Follow symbolic links. how或等于llow links at the end
4232  retry :
4233  error等于user_path_at(olddfd, oldname, how, & old_path)
4234  如果error则返回:error
4237  new_dentry等于user_path_create(newdfd, newname, & new_path, (how & ll ->d_revalidate() to trust no cache ))
4239  error等于错误
4240  如果是错误则转到:out
4243  error等于负EXDEV
4244  如果mnt不等于mnt则转到:out_dput
4246  error等于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)* -
4247  如果此条件成立可能性小(为编译器优化)(error)则转到:out_dput
4249  error等于security_path_link(dentry, & new_path, new_dentry)
4250  如果error则转到:out_dput
4252  error等于vfs_link - create a new link*@old_dentry: object to be linked*@dir: new parent*@new_dentry: where to create the new link*@delegated_inode: returns inode needing a delegation break* The caller must hold dir->i_mutex* If vfs_link discovers a delegation on
4253  out_dput :
4254  done_path_create( & new_path, new_dentry)
4255  如果delegated_inode
4256  error等于break_deleg_wait( & delegated_inode)
4257  如果非error
4259  转到:retry
4262  如果ry_estale - determine whether the caller should retry an operation*@error: the error that would currently be returned*@flags: flags being used for next lookup attempt* Check to see if the error code was -ESTALE, and then determine whether
4263  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
4264  how或等于ll ->d_revalidate() to trust no cache
4265  转到:retry
4267  out :
4268  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
4270  返回:error
调用者
名称描述
SYSCALL_DEFINE5
SYSCALL_DEFINE2
ksys_link