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]
Date:   Tue, 17 Mar 2020 19:47:08 +0800
From:   Hongbo Yao <yaohongbo@...wei.com>
To:     <will@...nel.org>, <broonie@...nel.org>
CC:     <yaohongbo@...wei.com>, <linux-kernel@...r.kernel.org>
Subject: [RFC PATCH] arm64: fix the missing ktpi= cmdline check in arm64_kernel_unmapped_at_el0()

Kpti cannot be disabled from the kernel cmdline after the commit
09e3c22a("arm64: Use a variable to store non-global mappings decision").

Bring back the missing check of kpti= command-line option to fix the
case where the SPE driver complains the missing "kpti-off" even it has
already been set.

Signed-off-by: Hongbo Yao <yaohongbo@...wei.com>
---
 arch/arm64/include/asm/mmu.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
index 3c9533322558..ebbc0d3ac2f7 100644
--- a/arch/arm64/include/asm/mmu.h
+++ b/arch/arm64/include/asm/mmu.h
@@ -34,7 +34,8 @@ extern bool arm64_use_ng_mappings;
 
 static inline bool arm64_kernel_unmapped_at_el0(void)
 {
-	return arm64_use_ng_mappings;
+	return arm64_use_ng_mappings &&
+		cpus_have_const_cap(ARM64_UNMAP_KERNEL_AT_EL0);
 }
 
 typedef void (*bp_hardening_cb_t)(void);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ