lkml.org 
[lkml]   [2017]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning
    On Wed, Jan 25, 2017 at 3:28 PM, Peter Zijlstra <peterz@infradead.org> wrote:
    > On Wed, Jan 25, 2017 at 03:25:24PM +0100, Peter Zijlstra wrote:
    >>
    >> 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.
    >>
    >> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    >> ---
    >
    > Seems to compile better when you add the required header files...
    >
    > mm/kasan/report.c | 3 +++
    > 1 file changed, 3 insertions(+)
    >
    > diff --git a/mm/kasan/report.c b/mm/kasan/report.c
    > index b82b3e2..3653ed1 100644
    > --- a/mm/kasan/report.c
    > +++ b/mm/kasan/report.c
    > @@ -24,6 +24,7 @@
    > #include <linux/types.h>
    > #include <linux/kasan.h>
    > #include <linux/module.h>
    > +#include <linux/ftrace.h>
    >
    > #include <asm/sections.h>
    >
    > @@ -300,6 +301,8 @@ void kasan_report(unsigned long addr, size_t size,
    > if (likely(!kasan_report_enabled()))
    > return;
    >
    > + disable_trace_on_warning();
    > +
    Who is going to enable tracing back after we're done?
    Note that KASAN errors are not fatal, and the first one may possibly
    occur quite early.
    > info.access_addr = (void *)addr;
    > info.access_size = size;
    > info.is_write = is_write;



    --
    Alexander Potapenko
    Software Engineer

    Google Germany GmbH
    Erika-Mann-Straße, 33
    80636 München

    Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
    Registergericht und -nummer: Hamburg, HRB 86891
    Sitz der Gesellschaft: Hamburg

    \
     
     \ /
      Last update: 2017-01-25 15:32    [W:3.840 / U:0.244 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site