Skip to content

Commit 4390813

Browse files
Al Virogregkh
authored andcommitted
LOOKUP_MOUNTPOINT: we are cleaning "jumped" flag too late
commit 4f0ed93 upstream. That (and traversals in case of umount .) should be done before complete_walk(). Either a braino or mismerge damage on queue reorders - either way, I should've spotted that much earlier. Fucked-up-by: Al Viro <viro@zeniv.linux.org.uk> X-Paperbag: Brown Fixes: 161aff1 "LOOKUP_MOUNTPOINT: fold path_mountpointat() into path_lookupat()" Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent de427b6 commit 4390813

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/namei.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,16 +2328,16 @@ static int path_lookupat(struct nameidata *nd, unsigned flags, struct path *path
23282328
while (!(err = link_path_walk(s, nd)) &&
23292329
(s = lookup_last(nd)) != NULL)
23302330
;
2331+
if (!err && unlikely(nd->flags & LOOKUP_MOUNTPOINT)) {
2332+
err = handle_lookup_down(nd);
2333+
nd->flags &= ~LOOKUP_JUMPED; // no d_weak_revalidate(), please...
2334+
}
23312335
if (!err)
23322336
err = complete_walk(nd);
23332337

23342338
if (!err && nd->flags & LOOKUP_DIRECTORY)
23352339
if (!d_can_lookup(nd->path.dentry))
23362340
err = -ENOTDIR;
2337-
if (!err && unlikely(nd->flags & LOOKUP_MOUNTPOINT)) {
2338-
err = handle_lookup_down(nd);
2339-
nd->flags &= ~LOOKUP_JUMPED; // no d_weak_revalidate(), please...
2340-
}
23412341
if (!err) {
23422342
*path = nd->path;
23432343
nd->path.mnt = NULL;

0 commit comments

Comments
 (0)