Commit 290da20
Al Viro
do_move_mount(): split the checks in subtree-of-our-ns and entire-anon cases
... and fix the breakage in anon-to-anon case. There are two cases
acceptable for do_move_mount() and mixing checks for those is making
things hard to follow.
One case is move of a subtree in caller's namespace.
* source and destination must be in caller's namespace
* source must be detachable from parent
Another is moving the entire anon namespace elsewhere
* source must be the root of anon namespace
* target must either in caller's namespace or in a suitable
anon namespace (see may_use_mount() for details).
* target must not be in the same namespace as source.
It's really easier to follow if tests are *not* mixed together...
Reviewed-by: Christian Brauner <brauner@kernel.org>
Fixes: 3b5260d ("Don't propagate mounts into detached trees")
Reported-by: Allison Karlitskaya <lis@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>1 parent 4954346 commit 290da20
1 file changed
+25
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3656 | 3656 | | |
3657 | 3657 | | |
3658 | 3658 | | |
3659 | | - | |
3660 | | - | |
3661 | | - | |
3662 | 3659 | | |
3663 | 3660 | | |
3664 | 3661 | | |
3665 | 3662 | | |
3666 | | - | |
3667 | | - | |
3668 | | - | |
3669 | | - | |
3670 | | - | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
3671 | 3672 | | |
3672 | | - | |
3673 | | - | |
3674 | | - | |
3675 | | - | |
3676 | | - | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
3677 | 3676 | | |
3678 | | - | |
3679 | | - | |
| 3677 | + | |
| 3678 | + | |
3680 | 3679 | | |
3681 | | - | |
3682 | | - | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
3683 | 3683 | | |
3684 | | - | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
3685 | 3692 | | |
3686 | 3693 | | |
3687 | | - | |
3688 | | - | |
3689 | | - | |
3690 | 3694 | | |
3691 | 3695 | | |
3692 | 3696 | | |
| |||
0 commit comments