mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] ARM: kasan: reserve shadow memory region
@ 2024-01-03 10:13 Ahmad Fatoum
  2024-01-03 13:58 ` Sascha Hauer
  2024-01-03 14:57 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-01-03 10:13 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We did not have any protection in place to ensure that KASAN shadow memory
isn't overwritten during boot. Add that now to avoid strange effects
during debugging.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/cpu/start.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 15f5b2937227..9f4cdfe67fbf 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -133,6 +133,10 @@ static int barebox_memory_areas_init(void)
 		request_sdram_region("board data", (unsigned long)barebox_boarddata,
 				     barebox_boarddata_size);
 
+	if (IS_ENABLED(CONFIG_KASAN))
+		request_sdram_region("kasan shadow", kasan_shadow_base,
+				     mem_malloc_start() - kasan_shadow_base);
+
 	return 0;
 }
 device_initcall(barebox_memory_areas_init);
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-03 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 10:13 [PATCH master] ARM: kasan: reserve shadow memory region Ahmad Fatoum
2024-01-03 13:58 ` Sascha Hauer
2024-01-03 14:57 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox