Skip to content

Call for testing and review of mount detach fixes

Eric W. Biederman containers linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9mnt: Improve the umount_tree flagsfs/namespace.c fs/pnode.h+16 -160 replies
2/9mnt: Don't propagate umounts in __detach_mountsfs/namespace.c+1 -10 replies
3/9mnt: In umount_tree reuse mnt_list instead of mnt_hashfs/namespace.c fs/pnode.c fs/pnode.h+23 -300 replies
4/9mnt: Add MNT_UMOUNT flagfs/namespace.c fs/pnode.c include/linux/mount.h+5 -10 replies
5/9mnt: Delay removal from the mount hash.fs/namespace.c fs/pnode.c+8 -60 replies
6/9mnt: Factor out __detach_mnt from detach_mntfs/namespace.c+10 -20 replies
7/9mnt: Simplify umount_treefs/namespace.c+1 -90 replies
8/9mnt: Remove redundant NULL tests in namespace_unlockfs/namespace.c+2 -40 replies
9/9mnt: Honor MNT_LOCKED when detaching mountsfs/namespace.c+43 -40 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNeilBrown
SeriesR-b R-b
1/9
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH review 0/9] Call for testing and review of mount detach fixes

Way back in October Andrey Vagin reported that umount(MNT_DETACH) could be used to defeat MNT_LOCKED.

That MNT_DETACH is allowed in user namespace comes from my early misunderstanding what MNT_DETACH does. My mistake.

To avoid breaking existing userspace the conflict between MNT_DETACH and MNT_LOCKED is fixed by leaving locked umounts attached in the mount hash table until the last reference goes away.

While investigating this issue I also found an issue with __detach_mounts. The code was unnecessarily and incorrectly triggering mount propagation. Resulting in too many mounts going away when a directory is deleted, and too many cpu cycles burned while doing that.

For those who like to see everything in a single tree the code is at:

git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git for-testing

Eric W. Biederman (9):
mnt: Improve the umount_tree flags
mnt: Don't propagate umounts in __detach_mounts
mnt: In umount_tree reuse mnt_list instead of mnt_hash
mnt: Add MNT_UMOUNT flag
mnt: Delay removal from the mount hash.
mnt: Factor out __detach_mnt from detach_mnt
mnt: Simplify umount_tree
mnt: Remove redundant NULL tests in namespace_unlock
mnt: Honor MNT_LOCKED when detaching mounts

 fs/namespace.c        | 150 +++++++++++++++++++++++++++++++-------------------
 fs/pnode.c            |   8 +--
 fs/pnode.h            |   3 +-
 include/linux/mount.h |   1 +
 4 files changed, 99 insertions(+), 63 deletions(-)