]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/fsmount_ns: add missing TARGETS and fix cap test
authorChristian Brauner <brauner@kernel.org>
Mon, 23 Mar 2026 16:41:08 +0000 (17:41 +0100)
committerChristian Brauner <brauner@kernel.org>
Tue, 14 Apr 2026 07:31:07 +0000 (09:31 +0200)
commit660c09404cdabfe969d58375e990d2955af59797
tree84fd3f55cc6a67197119c4bd6299e322a7461e7d
parentd38aa6cdee8e09d77ce3a6c5b04800fb3b146d69
selftests/fsmount_ns: add missing TARGETS and fix cap test

Add missing top-level kselftest TARGETS entries for empty_mntns and
fsmount_ns so that 'make kselftest' discovers and runs these tests.

Fix requires_cap_sys_admin test which always SKIPped because fsopen()
was called after enter_userns(), where CAP_SYS_ADMIN in the mount
namespace's user_ns is unavailable. Move fsopen/fsconfig before fork so
the configured fs_fd is inherited by the child, which then only needs to
call fsmount() after dropping privileges.

Fixes: 3ac7ea91f3d0 ("selftests: add FSMOUNT_NAMESPACE tests")
Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/Makefile
tools/testing/selftests/filesystems/fsmount_ns/fsmount_ns_test.c