lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250828103042.1412850-1-anders.roxell@linaro.org>
Date: Thu, 28 Aug 2025 12:30:42 +0200
From: Anders Roxell <anders.roxell@...aro.org>
To: shuah@...nel.org,
	brauner@...nel.org
Cc: linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	dan.carpenter@...aro.org,
	arnd@...db.de,
	benjamin.copeland@...aro.org,
	Anders Roxell <anders.roxell@...aro.org>
Subject: [PATCH] selftests/filesystems: Skip file_stressor test on NFS root

The file_stressor test creates directories in the root filesystem and
performs mount namespace operations that can fail on NFS root filesystems
due to network filesystem restrictions and permission limitations.

Add NFS root filesystem detection using statfs() to check for
NFS_SUPER_MAGIC and skip the test gracefully when running on NFS root,
providing a clear message about why the test was skipped.

This prevents spurious test failures in CI environments that use NFS
root while preserving the test's ability to catch SLAB_TYPESAFE_BY_RCU
related bugs on local filesystems where it can run properly.

Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
---
 tools/testing/selftests/filesystems/file_stressor.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/filesystems/file_stressor.c b/tools/testing/selftests/filesystems/file_stressor.c
index 01dd89f8e52f..b9dfe0b6b125 100644
--- a/tools/testing/selftests/filesystems/file_stressor.c
+++ b/tools/testing/selftests/filesystems/file_stressor.c
@@ -10,12 +10,14 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
+#include <sys/vfs.h>
 #include <unistd.h>
 
 #include "../kselftest_harness.h"
 
 #include <linux/types.h>
 #include <linux/mount.h>
+#include <linux/magic.h>
 #include <sys/syscall.h>
 
 static inline int sys_fsopen(const char *fsname, unsigned int flags)
@@ -58,8 +60,13 @@ FIXTURE(file_stressor) {
 
 FIXTURE_SETUP(file_stressor)
 {
+	struct statfs sfs;
 	int fd_context;
 
+	/* Skip test if root filesystem is NFS */
+	if (statfs("/", &sfs) == 0 && sfs.f_type == NFS_SUPER_MAGIC)
+		SKIP(return, "Test requires local root filesystem, NFS root detected");
+
 	ASSERT_EQ(unshare(CLONE_NEWNS), 0);
 	ASSERT_EQ(mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL), 0);
 	ASSERT_EQ(mkdir("/slab_typesafe_by_rcu", 0755), 0);
-- 
2.50.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ