diff options
-rw-r--r-- | fs/namespace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index ef42d9bee212..74647c2fe69c 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -2820,6 +2820,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, | |||
2820 | /* make sure we can reach put_old from new_root */ | 2820 | /* make sure we can reach put_old from new_root */ |
2821 | if (!is_path_reachable(old_mnt, old.dentry, &new)) | 2821 | if (!is_path_reachable(old_mnt, old.dentry, &new)) |
2822 | goto out4; | 2822 | goto out4; |
2823 | /* make certain new is below the root */ | ||
2824 | if (!is_path_reachable(new_mnt, new.dentry, &root)) | ||
2825 | goto out4; | ||
2823 | root_mp->m_count++; /* pin it so it won't go away */ | 2826 | root_mp->m_count++; /* pin it so it won't go away */ |
2824 | lock_mount_hash(); | 2827 | lock_mount_hash(); |
2825 | detach_mnt(new_mnt, &parent_path); | 2828 | detach_mnt(new_mnt, &parent_path); |