Merge patch series "mount: handle mount propagation for detached mount trees"
authorChristian Brauner <brauner@kernel.org>
Wed, 26 Feb 2025 09:46:32 +0000 (10:46 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 4 Mar 2025 08:29:55 +0000 (09:29 +0100)
commit06b1ce966e3f8bfef261c111feb3d4b33ede0cd8
treeb99277de00a63212b929b79bee6ff43aed17e6f7
parent99b6a1dee086e69d242c268a547714cae71d9e59
parente5c10b19b3a048512f91758d0f615597fbe68399
Merge patch series "mount: handle mount propagation for detached mount trees"

Christian Brauner <brauner@kernel.org> says:

In commit ee2e3f50629f ("mount: fix mounting of detached mounts onto
targets that reside on shared mounts") I fixed a bug where propagating
the source mount tree of an anonymous mount namespace into a target
mount tree of a non-anonymous mount namespace could be used to trigger
an integer overflow in the non-anonymous mount namespace causing any new
mounts to fail.

The cause of this was that the propagation algorithm was unable to
recognize mounts from the source mount tree that were already propagated
into the target mount tree and then reappeared as propagation targets
when walking the destination propagation mount tree.

When fixing this I disabled mount propagation into anonymous mount
namespaces. Make it possible for anonymous mount namespace to receive
mount propagation events correctly. This is no also a correctness issue
now that we allow mounting detached mount trees onto detached mount
trees.

Mark the source anonymous mount namespace with MNTNS_PROPAGATING
indicating that all mounts belonging to this mount namespace are
currently in the process of being propagated and make the propagation
algorithm discard those if they appear as propagation targets.

* patches from https://lore.kernel.org/r/20250225-work-mount-propagation-v1-0-e6e3724500eb@kernel.org:
  selftests: test subdirectory mounting
  selftests: add test for detached mount tree propagation
  mount: handle mount propagation for detached mount trees

Link: https://lore.kernel.org/r/20250225-work-mount-propagation-v1-0-e6e3724500eb@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>