aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 2651328d1790..fbba8b17330d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2915,6 +2915,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
2915 /* make sure we can reach put_old from new_root */ 2915 /* make sure we can reach put_old from new_root */
2916 if (!is_path_reachable(old_mnt, old.dentry, &new)) 2916 if (!is_path_reachable(old_mnt, old.dentry, &new))
2917 goto out4; 2917 goto out4;
2918 /* make certain new is below the root */
2919 if (!is_path_reachable(new_mnt, new.dentry, &root))
2920 goto out4;
2918 root_mp->m_count++; /* pin it so it won't go away */ 2921 root_mp->m_count++; /* pin it so it won't go away */
2919 lock_mount_hash(); 2922 lock_mount_hash();
2920 detach_mnt(new_mnt, &parent_path); 2923 detach_mnt(new_mnt, &parent_path);