kasan: support panic_on_warn
Subsystems (2)
[email protected]
maintainerPATCH 86/123 kasan: support panic_on_warn
From: Dmitry Vyukov <[email protected]>
Subject: kasan: support panic_on_warn
If user sets panic_on_warn, he wants kernel to panic if there is anything barely wrong with the kernel. KASAN-detected errors are definitely not less benign than an arbitrary kernel WARNING.
Panic after KASAN errors if panic_on_warn is set.
We use this for continuous fuzzing where we want kernel to stop and reboot on any error.
Signed-off-by Dmitry Vyukov <[email protected]>
Acked-by Andrey Ryabinin <[email protected]>
Cc Alexander Potapenko <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/kasan/report.c | 2 ++ 1 file changed, 2 insertions(+)
mm/kasan/report.c renamed from mm/kasan/report.c~kasan-support-panic_on_warn +2 -0
@@ -136,6 +136,8 @@ static void kasan_end_report(unsigned lopr_err ("==================================================================\n" );add_taint (TAINT_BAD_PAGE ,LOCKDEP_NOW_UNRELIABLE );spin_unlock_irqrestore (&report_lock, *flags); +if (panic_on_warn) +panic ("panic_on_warn set ...\n" );kasan_enable_current (); }
_