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 <[email protected]>
---
 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


Reply via email to