summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/filesystems/fuse/test_syncfs.c
AgeCommit message (Collapse)Author
2026-10-16selftests/fuse: add the missing FUSE_HAS_SYNCFS privilege testSasha Levin
Commit a6ca1a573e1f ("selftests/fuse: add test for FUSE_HAS_SYNCFS privilege gating") registered test_syncfs in the fuse selftest Makefile and .gitignore, but the test source was not part of the applied commit, so building the fuse selftests fails: make[1]: *** No rule to make target '.../test_syncfs', needed by 'all'. Add test_syncfs.c as posted in Jimmy Zuber's v3 submission. The test talks the raw FUSE protocol over /dev/fuse, so it can choose whether to advertise FUSE_HAS_SYNCFS and directly observe whether the kernel forwards a FUSE_SYNCFS request. It covers three cases: 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. Fixes: a6ca1a573e1f ("selftests/fuse: add test for FUSE_HAS_SYNCFS privilege gating") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202609021808.5OxsIter-lkp@intel.com/ Closes: https://lore.kernel.org/r/202609230913.G4keWCG7-lkp@intel.com/ Link: https://lore.kernel.org/r/20260820130158.254808-3-jamz@amazon.com Originally-by: Jimmy Zuber <jamz@amazon.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>