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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240205153503.574468-3-gregory.clement@bootlin.com>
Date: Mon,  5 Feb 2024 16:34:48 +0100
From: Gregory CLEMENT <gregory.clement@...tlin.com>
To: Paul Burton <paulburton@...nel.org>,
	Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
	linux-mips@...r.kernel.org,
	Jiaxun Yang <jiaxun.yang@...goat.com>,
	Rob Herring <robh+dt@...nel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
	devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Vladimir  Kondratiev <vladimir.kondratiev@...ileye.com>,
	Tawfik Bayouk <tawfik.bayouk@...ileye.com>,
	Alexandre Belloni <alexandre.belloni@...tlin.com>,
	Théo Lebrun <theo.lebrun@...tlin.com>,
	Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
	Vladimir Kondratiev <vladimir.kondratiev@...el.com>,
	Gregory CLEMENT <gregory.clement@...tlin.com>
Subject: [PATCH v7 02/14] MIPS: Fix set_uncached_handler for ebase in XKPHYS

From: Jiaxun Yang <jiaxun.yang@...goat.com>

ebase might reside in XKPHYS if memblock is unable to allocate memory
within the KSEG0 physical range.

To map EBASE into uncached space, we convert it back to its physical
address and utilize the new CKSEG1ADDR_OR_64BIT helper for mapping.

Co-developed-by: Vladimir Kondratiev <vladimir.kondratiev@...el.com>
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@...el.com>
Co-developed-by: Gregory CLEMENT <gregory.clement@...tlin.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@...tlin.com>
---
 arch/mips/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 0e3f2f2fa732b..355d0f0709de8 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -2295,7 +2295,7 @@ static const char panic_null_cerr[] =
 void set_uncached_handler(unsigned long offset, void *addr,
 	unsigned long size)
 {
-	unsigned long uncached_ebase = CKSEG1ADDR(ebase);
+	unsigned long uncached_ebase = CKSEG1ADDR_OR_64BIT(__pa(ebase));
 
 	if (!addr)
 		panic(panic_null_cerr);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ