mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
namei: only return -ECHILD from follow_dotdot_rcu()
commit2b98149c23
upstream. It's over-zealous to return hard errors under RCU-walk here, given that a REF-walk will be triggered for all other cases handling ".." under RCU. The original purpose of this check was to ensure that if a rename occurs such that a directory is moved outside of the bind-mount which the resolution started in, it would be detected and blocked to avoid being able to mess with paths outside of the bind-mount. However, triggering a new REF-walk is just as effective a solution. Cc: "Eric W. Biederman" <ebiederm@xmission.com> Fixes:397d425dc2
("vfs: Test for and handle paths that are unreachable from their mnt_root") Suggested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
713f632319
commit
7345a19c1a
1 changed files with 1 additions and 1 deletions
|
@ -1382,7 +1382,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
|
|||
nd->path.dentry = parent;
|
||||
nd->seq = seq;
|
||||
if (unlikely(!path_connected(&nd->path)))
|
||||
return -ENOENT;
|
||||
return -ECHILD;
|
||||
break;
|
||||
} else {
|
||||
struct mount *mnt = real_mount(nd->path.mnt);
|
||||
|
|
Loading…
Reference in a new issue