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-next>] [day] [month] [year] [list]
Message-ID: <20260108090606.20660-1-po-hsu.lin@canonical.com>
Date: Thu,  8 Jan 2026 17:06:05 +0800
From: Po-Hsu Lin <po-hsu.lin@...onical.com>
To: linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: po-hsu.lin@...onical.com,
	shuah@...nel.org,
	mike.kravetz@...cle.com
Subject: [PATCH 0/1] selftests/memfd: fix return value override issue in run_hugetlbfs_test.sh

If the clean up task in the end of this script has successed, this
test will be considered as passed regardless the sub tests results.

$ sudo ./run_hugetlbfs_test.sh
memfd-hugetlb: CREATE
memfd-hugetlb: BASIC
memfd-hugetlb: SEAL-EXEC
memfd-hugetlb:  Apply SEAL_EXEC
fchmod(/memfd:kern_memfd_seal_exec (deleted), 00777) didn't fail as expected
./run_hugetlbfs_test.sh: line 60: 16833 Aborted                 (core dumped) ./memfd_test hugetlbfs
opening: ./mnt/memfd
ADD_SEALS(4, 0 -> 8) failed: Device or resource busy
8 != 0 = GET_SEALS(4)
Aborted (core dumped)
$ echo $?
0

Fix this by checking the return value of each sub-test.

With this patch, the return value of this test will be reflected
correctly and we can avoid a false-negative result:
$ sudo ./run_hugetlbfs_test.sh
memfd-hugetlb: CREATE
memfd-hugetlb: BASIC
memfd-hugetlb: SEAL-EXEC
memfd-hugetlb:  Apply SEAL_EXEC
fchmod(/memfd:kern_memfd_seal_exec (deleted), 00777) didn't fail as expected
./run_hugetlbfs_test.sh: line 68: 16688 Aborted                 (core dumped) ./memfd_test hugetlbfs
opening: ./mnt/memfd
ADD_SEALS(4, 0 -> 8) failed: Device or resource busy
8 != 0 = GET_SEALS(4)
Aborted (core dumped)
$ echo $?
134


Po-Hsu Lin (1):
  selftests/memfd: fix return value override issue in
    run_hugetlbfs_test.sh

 tools/testing/selftests/memfd/run_hugetlbfs_test.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ