Commit 1d28c8d6 authored by Kees Cook's avatar Kees Cook Committed by Linus Torvalds

ubsan: check panic_on_warn

Syzkaller expects kernel warnings to panic when the panic_on_warn sysctl
is set.  More work is needed here to have UBSan reuse the WARN
infrastructure, but for now, just check the flag manually.
Signed-off-by: default avatarKees Cook <>
Signed-off-by: default avatarAndrew Morton <>
Cc: Alexander Potapenko <>
Cc: Andrey Konovalov <>
Cc: Andrey Ryabinin <>
Cc: Ard Biesheuvel <>
Cc: Arnd Bergmann <>
Cc: Dan Carpenter <>
Cc: Dmitry Vyukov <>
Cc: Elena Petrova <>
Cc: "Gustavo A. R. Silva" <>
Link: default avatarLinus Torvalds <>
parent ae2e1aad
......@@ -156,6 +156,17 @@ static void ubsan_epilogue(void)
if (panic_on_warn) {
* This thread may hit another WARN() in the panic path.
* Resetting this prevents additional WARN() from panicking the
* system on this thread. Other threads are blocked by the
* panic_mutex in panic().
panic_on_warn = 0;
panic("panic_on_warn set ...\n");
static void handle_overflow(struct overflow_data *data, void *lhs,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment