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: <20260118145441.291302-1-guoren@kernel.org>
Date: Sun, 18 Jan 2026 09:54:41 -0500
From: guoren@...nel.org
To: guoren@...nel.org,
	palmer@...belt.com,
	bjorn@...nel.org,
	cuiyunhui@...edance.com,
	samuel.holland@...ive.com,
	pjw@...nel.org,
	alex@...ti.fr,
	fangyu.yu@...ux.alibaba.com
Cc: linux-kernel@...r.kernel.org,
	linux-riscv@...ts.infradead.org,
	Alexandre Ghiti <alexghiti@...osinc.com>,
	Björn Töpel <bjorn@...osinc.com>
Subject: [PATCH] riscv: mm: Fixup no5lvl fails on physical address base = 128TiB

From: "Guo Ren (Alibaba DAMO Academy)" <guoren@...nel.org>

Unlike no4lvl, no5lvl still continues detect satp, which
requires va=pa mapping. When pa=0x800000000000, no5lvl
would fail in Sv48 mode due to an illegal VA value of
0x800000000000.

So, prevent detecting the satp flow for no5lvl, which is
the same as no4lvl. That means the user needs to know the
machine's exact mode when using no5lvl.

Fixes: 26e7aacb83df ("riscv: Allow to downgrade paging mode from the command line")
Cc: Alexandre Ghiti <alexghiti@...osinc.com>
Cc: Björn Töpel <bjorn@...osinc.com>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@...nel.org>
---
 arch/riscv/mm/init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index addb8a9305be..6b526f1e276a 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -872,6 +872,7 @@ static __init void set_satp_mode(uintptr_t dtb_pa)
 
 	if (satp_mode_limit == SATP_MODE_48) {
 		disable_pgtable_l5();
+		return;
 	} else if (satp_mode_limit == SATP_MODE_39) {
 		disable_pgtable_l5();
 		disable_pgtable_l4();
-- 
2.40.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ