selftests/filesystems: check that a recursive bind mount can't pin the caller's mount namespace

Add a test for a recursive bind mount of a namespace file in another mount
namespace:

- a bind mount of the network namespace file, held through a descriptor
- the caller's own mount namespace file stacked on top of it there
- the recursive bind mount through the descriptor fails with EINVAL
- a plain bind mount of the file still works

The copy would pin the namespace it is put in otherwise.

Link: https://patch.msgid.link/20260930-work-mount-fixes-3-v1-5-be34c83956ae@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2026-09-30 15:31:57 +02:00
commit 7c07b18300
No known key found for this signature in database
GPG key ID: 91C61BC06578DCA2
3 changed files with 195 additions and 0 deletions