kasan: support panic_on_warn
Subsystems (2)
Dmitry Vyukov
reviewerPATCH v2 1/1 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.
---
Changes from v1:
- don't reset panic_on_warn before calling panic()
--- mm/kasan/report.c | 2 ++ 1 file changed, 2 insertions(+)
mm/kasan/report.c +2 -0
@@ -133,6 +133,8 @@ static void kasan_end_report(unsigned long *flags)pr_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 (); }
Signature · 7 lines
2.8.0.rc3.226.g39d4020 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Dmitry Vyukov
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_warnis set.We use this for continuous fuzzing where we want kernel to stop and reboot on any error.
Quoted 8 lines
Signed-off-by Dmitry Vyukov <[email protected]>Cc Andrey Ryabinin <[email protected]>Cc Alexander Potapenko <[email protected]>Cc Andrew Morton <[email protected]>
Quoted 14 lines
---
Changes from v1:
- don't resetpanic_on_warnbefore callingpanic()--- mm/kasan/report.c | 2 ++ 1 file changed, 2 insertions(+)mm/kasan/report.c +0
-0
mm/kasan/report.c static void kasan_end_report(unsigned long *flags) · line 140
Quoted 8 lines
mm/kasan/report.c +2
-0@@ -133,6 +133,8 @@ static void kasan_end_report(unsigned long *flags)pr_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 (); }
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>