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>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250616060423.2180088-2-po-hsu.lin@canonical.com>
Date: Mon, 16 Jun 2025 14:04:23 +0800
From: Po-Hsu Lin <po-hsu.lin@...onical.com>
To: linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: shuah@...nel.org,
	po-hsu.lin@...onical.com
Subject: [PATCH 1/1] selftests/memfd: skip hugetlbfs test if not supported

Check hugetlbfs support before starting tests in run_hugetlbfs_test.sh.

Otherwise on a system that does not support hugetlbfs the free huge
pages availability check will fail with:
  ./run_hugetlbfs_test.sh: line 47: [: -lt: unary operator expected
  ./run_hugetlbfs_test.sh: line 60: 12577 Aborted                 (core dumped) ./memfd_test hugetlbfs
  Aborted (core dumped)

And it will left a fuse_mnt process behind, which may cause some
unexpected issues.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@...onical.com>
---
 tools/testing/selftests/memfd/run_hugetlbfs_test.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/testing/selftests/memfd/run_hugetlbfs_test.sh b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
index fb633eeb0290..15f4d1299563 100755
--- a/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
+++ b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
@@ -10,6 +10,11 @@ ksft_skip=4
 #
 hpages_test=8
 
+if ! grep -q hugetlbfs /proc/filesystems; then
+	echo "hugetlbfs not supported, test skipped."
+	exit $ksft_skip
+fi
+
 #
 # Get count of free huge pages from /proc/meminfo
 #
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ