Skip to content

Commit 55d0f89

Browse files
Peter Zijlstragregkh
authored andcommitted
kasan: respect /proc/sys/kernel/traceoff_on_warning
[ Upstream commit 4f40c6e5627ea73b4e7c615c59631f38cc880885 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1948d0a commit 55d0f89

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

mm/kasan/report.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*
1414
*/
1515

16+
#include <linux/ftrace.h>
1617
#include <linux/kernel.h>
1718
#include <linux/mm.h>
1819
#include <linux/printk.h>
@@ -251,6 +252,8 @@ void kasan_report(unsigned long addr, size_t size,
251252
if (likely(!kasan_report_enabled()))
252253
return;
253254

255+
disable_trace_on_warning();
256+
254257
info.access_addr = (void *)addr;
255258
info.access_size = size;
256259
info.is_write = is_write;

0 commit comments

Comments
 (0)