Guest User

PivotrootInvalidArgument.patch

a guest
Jan 22nd, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. diff --git a/fs/namespace.c b/fs/namespace.c
  2. index 06f8e63..110a7f4 100644
  3. --- a/fs/namespace.c
  4. +++ b/fs/namespace.c
  5. @@ -2227,12 +2227,12 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
  6. error = -EINVAL;
  7. if (root.mnt->mnt_root != root.dentry)
  8. goto out2; /* not a mountpoint */
  9. - if (root.mnt->mnt_parent == root.mnt)
  10. - goto out2; /* not attached */
  11. +// if (root.mnt->mnt_parent == root.mnt)
  12. +// goto out2; /* not attached */
  13. if (new.mnt->mnt_root != new.dentry)
  14. goto out2; /* not a mountpoint */
  15. - if (new.mnt->mnt_parent == new.mnt)
  16. - goto out2; /* not attached */
  17. +// if (new.mnt->mnt_parent == new.mnt)
  18. +// goto out2; /* not attached */
  19. /* make sure we can reach put_old from new_root */
  20. tmp = old.mnt;
  21. spin_lock(&vfsmount_lock);
  22. @@ -2250,6 +2250,9 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
  23. goto out3;
  24. detach_mnt(new.mnt, &parent_path);
  25. detach_mnt(root.mnt, &root_parent);
  26. + if (root.mnt == current->nsproxy->mnt_ns->root) {
  27. + root_parent.mnt = new.mnt; /* avoid creating a mount loop */
  28. + }
  29. /* mount old root on put_old */
  30. attach_mnt(root.mnt, &old);
  31. /* mount new_root on / */
Advertisement
Add Comment
Please, Sign In to add comment