summaryrefslogtreecommitdiff
path: root/mm/kasan
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-12-12 16:44:53 -0800
committerPaul Lawrence <paullawrence@google.com>2017-12-14 08:24:47 -0800
commit418991b870f79c681fb3499a520a69cda6788959 (patch)
tree92db0f471a8abf0464dd06e5ff3baf2af138ec15 /mm/kasan
parent915047a1dea413c6bc9726fd36725a685ee14852 (diff)
UPSTREAM: 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@google.com> Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Alexander Potapenko <glider@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Bug: 64145065 (cherry-picked from 5c5c1f36cedfb51ec291181e71817f7fe7e03ee2) Change-Id: Iee7cbc4ffbce8eb8d827447fdf960a6520d10b00 Signed-off-by: Paul Lawrence <paullawrence@google.com>
Diffstat (limited to 'mm/kasan')
-rw-r--r--mm/kasan/report.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index 8ca412aebcf1..f479365530b6 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -137,6 +137,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();
}