Message ID | 1421344167-7559-4-git-send-email-luis.henriques@canonical.com |
---|---|
State | New |
Headers | show |
Ok that one at least is not complicated... :)
diff --git a/fs/namespace.c b/fs/namespace.c index eaf076a2ed4a..5b10772f323a 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2691,6 +2691,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, /* make sure we can reach put_old from new_root */ if (!is_path_reachable(old.mnt, old.dentry, &new)) goto out4; + /* make certain new is below the root */ + if (!is_path_reachable(new.mnt, new.dentry, &root)) + goto out4; br_write_lock(vfsmount_lock); detach_mnt(new.mnt, &parent_path); detach_mnt(root.mnt, &root_parent);