]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
namei: only return -ECHILD from follow_dotdot_rcu()
authorAleksa Sarai <cyphar@cyphar.com>
Fri, 6 Dec 2019 14:13:26 +0000 (01:13 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Mar 2020 15:45:21 +0000 (16:45 +0100)
commit02ecee5f380fcbad9ce0e48ac088596d956c3f72
tree1e61b83dfe1448033acd2a943bd9bd2ca338da81
parent9184d43bf6c9dfa337e1e7290ca89f894aa462ff
namei: only return -ECHILD from follow_dotdot_rcu()

commit 2b98149c2377bff12be5dd3ce02ae0506e2dd613 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: 397d425dc26d ("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>
fs/namei.c