[Devel] [PATCH RHEL7 COMMIT] ms/kasan: support panic_on_warn

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 30 13:42:50 MSK 2017


The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.19
------>
commit 7398e66cc6da106564c8eca609e0818d4a2fccc5
Author: Dmitry Vyukov <dvyukov at google.com>
Date:   Mon Oct 30 13:42:50 2017 +0300

    ms/kasan: support panic_on_warn
    
    ms commit: 5c5c1f3 ("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.
    
    Link: http://lkml.kernel.org/r/1476694764-31986-1-git-send-email-dvyukov@google.com
    Signed-off-by: Dmitry Vyukov <dvyukov at google.com>
    Acked-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
    Cc: Alexander Potapenko <glider at google.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
    
    https://jira.sw.ru/browse/PSBM-75786
    
    Signed-off-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
---
 mm/kasan/report.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index cbd7f6e..8070826 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -115,6 +115,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();
 }
 


More information about the Devel mailing list