diff options
author | Peter Zijlstra <peterz@infradead.org> | 2017-02-03 16:13:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-03 17:13:19 -0500 |
commit | 4f40c6e5627ea73b4e7c615c59631f38cc880885 (patch) | |
tree | f1271c5000809746eef65329b4676430987438bc | |
parent | d7b028f56a971a2e4d8d7887540a144eeefcd4ab (diff) |
kasan: respect /proc/sys/kernel/traceoff_on_warning
After much waiting I finally reproduced a KASAN issue, only to find my
trace-buffer empty of useful information because it got spooled out :/
Make kasan_report honour the /proc/sys/kernel/traceoff_on_warning
interface.
Link: http://lkml.kernel.org/r/20170125164106.3514-1-aryabinin@virtuozzo.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Acked-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/kasan/report.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/kasan/report.c b/mm/kasan/report.c index b82b3e215157..f479365530b6 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c | |||
@@ -13,6 +13,7 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/ftrace.h> | ||
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
17 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
18 | #include <linux/printk.h> | 19 | #include <linux/printk.h> |
@@ -300,6 +301,8 @@ void kasan_report(unsigned long addr, size_t size, | |||
300 | if (likely(!kasan_report_enabled())) | 301 | if (likely(!kasan_report_enabled())) |
301 | return; | 302 | return; |
302 | 303 | ||
304 | disable_trace_on_warning(); | ||
305 | |||
303 | info.access_addr = (void *)addr; | 306 | info.access_addr = (void *)addr; |
304 | info.access_size = size; | 307 | info.access_size = size; |
305 | info.is_write = is_write; | 308 | info.is_write = is_write; |