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: <20240912100018.736447-1-zhangchunyan@iscas.ac.cn>
Date: Thu, 12 Sep 2024 18:00:18 +0800
From: Chunyan Zhang <zhangchunyan@...as.ac.cn>
To: Andrew Morton <akpm@...ux-foundation.org>,
	Shuah Khan <shuah@...nel.org>,
	Paul Walmsley <paul.walmsley@...ive.com>,
	Palmer Dabbelt <palmer@...belt.com>,
	Alexandre Ghiti <alex@...ti.fr>
Cc: linux-mm@...ck.org,
	linux-kselftest@...r.kernel.org,
	linux-riscv@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	Chunyan Zhang <zhang.lyra@...il.com>
Subject: [PATCH] selftest/mm: Do not use hint for riscv mmap

When the virtual address range selftest is run on RISC-V platforms,
it is observed that using the hint address when calling mmap cannot
get the address in the range of that validate_addr() checks, also
that will cause '/proc/self/maps' have gaps larger than MAP_CHUNK_SIZE.

Signed-off-by: Chunyan Zhang <zhangchunyan@...as.ac.cn>
---
 tools/testing/selftests/mm/virtual_address_range.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/testing/selftests/mm/virtual_address_range.c b/tools/testing/selftests/mm/virtual_address_range.c
index 4e4c1e311247..25f3eb304999 100644
--- a/tools/testing/selftests/mm/virtual_address_range.c
+++ b/tools/testing/selftests/mm/virtual_address_range.c
@@ -64,6 +64,14 @@
 #define NR_CHUNKS_HIGH  NR_CHUNKS_384TB
 #endif
 
+#if defined(__riscv) && (__riscv_xlen == 64)
+static char *hind_addr(void)
+{
+	return NULL;
+}
+
+static void validate_addr(char *ptr, int high_addr) { }
+#else
 static char *hind_addr(void)
 {
 	int bits = HIGH_ADDR_SHIFT + rand() % (63 - HIGH_ADDR_SHIFT);
@@ -81,6 +89,7 @@ static void validate_addr(char *ptr, int high_addr)
 	if (addr > HIGH_ADDR_MARK)
 		ksft_exit_fail_msg("Bad address %lx\n", addr);
 }
+#endif
 
 static int validate_lower_address_hint(void)
 {
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ