Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1566646 > unrolled thread

[PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning

Started byPeter Zijlstra <peterz@infradead.org>
First post2017-01-25 15:30 +0100
Last post2017-01-25 16:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning Peter Zijlstra <peterz@infradead.org> - 2017-01-25 15:30 +0100
    Re: [PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning Alexander Potapenko <glider@google.com> - 2017-01-25 15:40 +0100
    Re: [PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning kbuild test robot <lkp@intel.com> - 2017-01-25 16:40 +0100

#1566646 — [PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning

FromPeter Zijlstra <peterz@infradead.org>
Date2017-01-25 15:30 +0100
Subject[PATCH] kasan: Respect /proc/sys/kernel/traceoff_on_warning
Message-ID<t3wKd-2S1-3@gated-at.bofh.it>
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>
---
 mm/kasan/report.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index b82b3e2..6ff7efc 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -300,6 +300,8 @@ void kasan_report(unsigned long addr, size_t size,
 	if (likely(!kasan_report_enabled()))
 		return;
 
+	disable_trace_on_warning();
+
 	info.access_addr = (void *)addr;
 	info.access_size = size;
 	info.is_write = is_write;

[toc] | [next] | [standalone]


#1566651

FromAlexander Potapenko <glider@google.com>
Date2017-01-25 15:40 +0100
Message-ID<t3wTU-2VB-33@gated-at.bofh.it>
In reply to#1566646
On Wed, Jan 25, 2017 at 3:25 PM, Peter Zijlstra <peterz@infradead.org> 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>
Acked-by: Alexander Potapenko <glider@google.com>
> ---
>  mm/kasan/report.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/mm/kasan/report.c b/mm/kasan/report.c
> index b82b3e2..6ff7efc 100644
> --- a/mm/kasan/report.c
> +++ b/mm/kasan/report.c
> @@ -300,6 +300,8 @@ void kasan_report(unsigned long addr, size_t size,
>         if (likely(!kasan_report_enabled()))
>                 return;
>
> +       disable_trace_on_warning();
> +
>         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

[toc] | [prev] | [next] | [standalone]


#1566693

Fromkbuild test robot <lkp@intel.com>
Date2017-01-25 16:40 +0100
Message-ID<t3xPZ-3w9-49@gated-at.bofh.it>
In reply to#1566646

[Multipart message — attachments visible in raw view] — view raw

Hi Peter,

[auto build test ERROR on mmotm/master]
[also build test ERROR on v4.10-rc5 next-20170125]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Peter-Zijlstra/kasan-Respect-proc-sys-kernel-traceoff_on_warning/20170125-230535
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: x86_64-randconfig-x008-201704 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   mm/kasan/report.c: In function 'kasan_report':
>> mm/kasan/report.c:303:2: error: implicit declaration of function 'disable_trace_on_warning' [-Werror=implicit-function-declaration]
     disable_trace_on_warning();
     ^~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/disable_trace_on_warning +303 mm/kasan/report.c

   297	{
   298		struct kasan_access_info info;
   299	
   300		if (likely(!kasan_report_enabled()))
   301			return;
   302	
 > 303		disable_trace_on_warning();
   304	
   305		info.access_addr = (void *)addr;
   306		info.access_size = size;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web