mount: a few gnarly fixes
Get series with b4
b4 am [email protected] change-id 20260923-work-mount-fixes-c9f19fb484ebVersions newest first
- v1 Latest8 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | mount: keep a copied mount unbindablefs/ | +1 | 0 replies | |
| 2/8 | selftests/filesystems: check that a copied mount namespace keeps unbindabletools/ tools/ tools/ | +234 | 0 replies | |
| 3/8 | mount: refuse MOVE_MOUNT_SET_GROUP on an unbindable mountfs/ | +1 | 0 replies | |
| 4/8 | selftests/move_mount_set_group: check that an unbindable target is refusedtools/ | +68 | 0 replies | |
| 5/8 | fs: don't silently unmount busy mountsfs/ | +90 | 2 replies | |
| 6/8 | selftests/filesystems: check that a busy propagated copy blocks a synchronous umounttools/ tools/ tools/ | +233 | 0 replies | |
| 7/8 | fs: don't let a migrating task hide its reference from do_umount()fs/ fs/ | +32 | 0 replies | |
| 8/8 | docs: update the unmount propagation ruleDocumentation/ | +14 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8] mount: a few gnarly fixes
Hey,
A short while ago I received a bug report about problematic behavior in the mount code and that let me to review and model a few corner cases including reference counting. The result is the following set of fixes:
- Ensure that copies of unbindable mounts remain unbindable
- Ensure that MOVE_MOUNT_SET_GROUP doesn't operate on unbindable mounts so we don't create an undefined state where a mount is both unbindable and a slave mount.
- Ensure that we don't silently unmount busy mounts. This is nasty because it's an old bug from v4.13 where calculation of whether a synchronous (non-MNT_DETACH) umount would succeed drifted apart from the actual codepath that did the unmount.
- Ensure that we don't silently unmount busy mounts. Same class, different mechanism. There's a race between the reference count check in propagate_mount_busy() (summing up per-cpu counters) and mntget().
Fixes and test for all. No test for the mntget() race because that needs aritifical delays.
And fwiw, I think I another vomitorious series in the pipes.
---
Christian Brauner (8):
mount: keep a copied mount unbindable
selftests/filesystems: check that a copied mount namespace keeps unbindable
mount: refuse MOVE_MOUNT_SET_GROUP on an unbindable mount selftests/move_mount_set_group: check that an unbindable target is refused
fs: don't silently unmount busy mounts
selftests/filesystems: check that a busy propagated copy blocks a synchronous umount
fs: don't let a migrating task hide its reference from do_umount()
docs: update the unmount propagation rule
Documentation/filesystems/sharedsubtree.rst | 20 +- fs/mount.h | 3 +- fs/namespace.c | 51 +++-- fs/pnode.c | 108 ++++++++-- tools/testing/selftests/Makefile | 2 + .../filesystems/mntns_unbindable/Makefile | 6 + .../mntns_unbindable/mntns_unbindable_test.c | 227 +++++++++++++++++++++ .../filesystems/umount_propagation/Makefile | 6 + .../umount_propagation/umount_propagation_test.c | 226 ++++++++++++++++++++ .../move_mount_set_group_test.c | 74 ++++++- 10 files changed, 673 insertions(+), 50 deletions(-)
---
base-commit: 2d2a2d7aa98741b58f54cacc99b52024e4d865f9
change-id: 20260923-work-mount-fixes-c9f19fb484eb