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: <20221025152610.3439102-1-gerald.schaefer@linux.ibm.com>
Date:   Tue, 25 Oct 2022 17:26:10 +0200
From:   Gerald Schaefer <gerald.schaefer@...ux.ibm.com>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Shuah Khan <shuah@...nel.org>,
        Muchun Song <songmuchun@...edance.com>
Cc:     linux-mm <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>,
        <linux-kselftest@...r.kernel.org>,
        linux-s390 <linux-s390@...r.kernel.org>
Subject: [PATCH] selftests: vm: use 1 MB hugepage size for s390

hugepage-vmemmap test fails for s390 because it assumes a hugepagesize
of 2 MB, while we have 1 MB on s390. This results in iterating over two
hugepages. If they are consecutive in memory, check_page_flags() will
stumble over the additional head page. Otherwise, it will stumble over
non-huge pageflags, after crossing the first 1 MB hugepage.

Fix this by using 1 MB MAP_LENGTH for s390.

Signed-off-by: Gerald Schaefer <gerald.schaefer@...ux.ibm.com>
---
 tools/testing/selftests/vm/hugepage-vmemmap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/vm/hugepage-vmemmap.c b/tools/testing/selftests/vm/hugepage-vmemmap.c
index 557bdbd4f87e..a4695f138cec 100644
--- a/tools/testing/selftests/vm/hugepage-vmemmap.c
+++ b/tools/testing/selftests/vm/hugepage-vmemmap.c
@@ -11,7 +11,14 @@
 #include <sys/mman.h>
 #include <fcntl.h>
 
+/*
+ * 1 MB hugepage size for s390
+ */
+#if defined(__s390x__)
+#define MAP_LENGTH		(1UL * 1024 * 1024)
+#else
 #define MAP_LENGTH		(2UL * 1024 * 1024)
+#endif
 
 #ifndef MAP_HUGETLB
 #define MAP_HUGETLB		0x40000	/* arch specific */
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ