mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
selftests/fuse: add test for FUSE_HAS_SYNCFS privilege gating
Add a selftest that talks the raw FUSE protocol over /dev/fuse (rather
than via libfuse, which negotiates INIT internally) so it can both choose
whether to advertise FUSE_HAS_SYNCFS and directly observe whether a
FUSE_SYNCFS opcode is forwarded by the kernel.
Three cases are covered:
T1: host-root mount, server sets FUSE_HAS_SYNCFS
-> FUSE_SYNCFS must reach the server.
T2: host-root mount, server does not opt in
-> FUSE_SYNCFS must not be sent (back-compat).
T3: server opts in but opened /dev/fuse without CAP_SYS_ADMIN while still
in the initial user namespace
-> FUSE_SYNCFS must be withheld. This is the case that distinguishes
gating on the server's privilege from gating on the mount's user
namespace.
Signed-off-by: Jimmy Zuber <jamz@amazon.com>
Assisted-by: Claude:claude-opus-4-8 [Claude-Code]
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
989db66818
commit
a6ca1a573e
|
|
@ -1,4 +1,5 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
fuse_mnt
|
||||
fusectl_test
|
||||
test_syncfs
|
||||
write_extend_eof_test
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES)
|
||||
|
||||
TEST_GEN_PROGS := fusectl_test
|
||||
TEST_GEN_PROGS := fusectl_test test_syncfs
|
||||
TEST_GEN_PROGS += write_extend_eof_test
|
||||
TEST_GEN_FILES := fuse_mnt
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user