Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/fs/namespace.c b/fs/namespace.c
- index 06f8e63..110a7f4 100644
- --- a/fs/namespace.c
- +++ b/fs/namespace.c
- @@ -2227,12 +2227,12 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
- error = -EINVAL;
- if (root.mnt->mnt_root != root.dentry)
- goto out2; /* not a mountpoint */
- - if (root.mnt->mnt_parent == root.mnt)
- - goto out2; /* not attached */
- +// if (root.mnt->mnt_parent == root.mnt)
- +// goto out2; /* not attached */
- if (new.mnt->mnt_root != new.dentry)
- goto out2; /* not a mountpoint */
- - if (new.mnt->mnt_parent == new.mnt)
- - goto out2; /* not attached */
- +// if (new.mnt->mnt_parent == new.mnt)
- +// goto out2; /* not attached */
- /* make sure we can reach put_old from new_root */
- tmp = old.mnt;
- spin_lock(&vfsmount_lock);
- @@ -2250,6 +2250,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
- goto out3;
- detach_mnt(new.mnt, &parent_path);
- detach_mnt(root.mnt, &root_parent);
- + if (root.mnt == current->nsproxy->mnt_ns->root) {
- + root_parent.mnt = new.mnt; /* avoid creating a mount loop */
- + }
- /* mount old root on put_old */
- attach_mnt(root.mnt, &old);
- /* mount new_root on / */
Advertisement
Add Comment
Please, Sign In to add comment