Merge patch series "mount: a few gnarly fixes"

Christian Brauner <brauner@kernel.org> says:

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.

* patches from https://patch.msgid.link/20260923-work-mount-fixes-v1-0-f424cf8d3242@kernel.org:
  docs: update the unmount propagation rule
  fs: don't let a migrating task hide its reference from do_umount()
  selftests/filesystems: check that a busy propagated copy blocks a synchronous umount
  fs: don't silently unmount busy mounts
  selftests/move_mount_set_group: check that an unbindable target is refused
  mount: refuse MOVE_MOUNT_SET_GROUP on an unbindable mount
  selftests/filesystems: check that a copied mount namespace keeps unbindable
  mount: keep a copied mount unbindable

Link: https://patch.msgid.link/20260923-work-mount-fixes-v1-0-f424cf8d3242@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2026-09-25 17:20:36 +02:00
commit 762a6411a5
No known key found for this signature in database
GPG key ID: 91C61BC06578DCA2
10 changed files with 673 additions and 50 deletions