]> www.infradead.org Git - users/hch/misc.git/commitdiff
pivot_root(2): use old_mp.mp->m_dentry instead of old.dentry
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 20 Aug 2025 04:26:44 +0000 (00:26 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:26:05 +0000 (21:26 -0400)
That kills the last place where callers of lock_mount(path, &mp)
used path->dentry.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c

index a931bc9598bdabfe1106de1a6563b5bbd0a7ca31..8c5f5b1edcedc2c8f945bc4a16edd74c6f79f225 100644 (file)
@@ -4670,7 +4670,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
        if (!mnt_has_parent(new_mnt))
                return -EINVAL; /* absolute root */
        /* make sure we can reach put_old from new_root */
-       if (!is_path_reachable(old_mnt, old.dentry, &new))
+       if (!is_path_reachable(old_mnt, old_mp.mp->m_dentry, &new))
                return -EINVAL;
        /* make certain new is below the root */
        if (!is_path_reachable(new_mnt, new.dentry, &root))