mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] KASan: turn warning into panic if CONFIG_BUG_ON_DATA_CORRUPTION=y
@ 2026-01-26 10:56 Ahmad Fatoum
  2026-01-27  7:34 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-01-26 10:56 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Especially for use during automated testing, it's useful to have barebox
panic on KASAN issues.

Let's do so when CONFIG_BUG_ON_DATA_CORRUPTION=y.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 lib/kasan/report.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/kasan/report.c b/lib/kasan/report.c
index b7844e93553c..c15a9c942f35 100644
--- a/lib/kasan/report.c
+++ b/lib/kasan/report.c
@@ -179,6 +179,9 @@ static void __kasan_report(unsigned long addr, size_t size, bool is_write,
 	}
 
 	end_report(&flags);
+
+	if (IS_ENABLED(CONFIG_BUG_ON_DATA_CORRUPTION))
+		panic_no_stacktrace("");
 }
 
 bool kasan_report(unsigned long addr, size_t size, bool is_write,
-- 
2.47.3




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

* Re: [PATCH] KASan: turn warning into panic if CONFIG_BUG_ON_DATA_CORRUPTION=y
  2026-01-26 10:56 [PATCH] KASan: turn warning into panic if CONFIG_BUG_ON_DATA_CORRUPTION=y Ahmad Fatoum
@ 2026-01-27  7:34 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-01-27  7:34 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Mon, 26 Jan 2026 11:56:05 +0100, Ahmad Fatoum wrote:
> Especially for use during automated testing, it's useful to have barebox
> panic on KASAN issues.
> 
> Let's do so when CONFIG_BUG_ON_DATA_CORRUPTION=y.
> 
> 

Applied, thanks!

[1/1] KASan: turn warning into panic if CONFIG_BUG_ON_DATA_CORRUPTION=y
      https://git.pengutronix.de/cgit/barebox/commit/?id=41924a330054 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2026-01-27  7:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-26 10:56 [PATCH] KASan: turn warning into panic if CONFIG_BUG_ON_DATA_CORRUPTION=y Ahmad Fatoum
2026-01-27  7:34 ` Sascha Hauer

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