Skip to content

Commit 781091f

Browse files
amir73ilbrauner
authored andcommitted
selftests/fs/mount-notify: add a test variant running inside userns
unshare userns in addition to mntns and verify that: 1. watching tmpfs mounted inside userns is allowed with any mark type 2. watching orig root with filesystem mark type is not allowed 3. watching mntns of orig userns is not allowed 4. watching mntns in userns where fanotify_init was called is allowed mount events are only tested with the last case of mntns mark. Signed-off-by: Amir Goldstein <[email protected]> Link: https://lore.kernel.org/[email protected] Reviewed-by: Christian Brauner <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 8199e6f commit 781091f

File tree

3 files changed

+560
-1
lines changed

3 files changed

+560
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
/*_test
3+
/*_test_ns

tools/testing/selftests/filesystems/mount-notify/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES) $(TOOLS_INCLUDES)
44
LDLIBS += -lcap
55

6-
TEST_GEN_PROGS := mount-notify_test
6+
TEST_GEN_PROGS := mount-notify_test mount-notify_test_ns
77

88
include ../../lib.mk
99

1010
$(OUTPUT)/mount-notify_test: ../utils.c
11+
$(OUTPUT)/mount-notify_test_ns: ../utils.c

0 commit comments

Comments
 (0)