All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: lkp@lists.01.org
Subject: Re: [hw_breakpoint] WARNING: at kernel/trace/trace_kprobe.c:1393 kprobe_trace_self_tests_init()
Date: Wed, 01 Oct 2014 11:18:48 +0900	[thread overview]
Message-ID: <542B6488.9090902@hitachi.com> (raw)
In-Reply-To: <20140930175844.GA20922@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3763 bytes --]

(2014/10/01 2:58), Oleg Nesterov wrote:
> Hi Fengguang,
> 
> On 09/30, Fengguang Wu wrote:
>>
>> Hi Oleg,
>>
>> 0day kernel testing robot got the below dmesg and the first bad commit is
>>
>> commit 8b4d801b2b123b6c09742f861fe44a8527b84d47
>> Author:     Oleg Nesterov <oleg@redhat.com>
>> AuthorDate: Thu Jun 20 17:50:06 2013 +0200
>> Commit:     Ingo Molnar <mingo@kernel.org>
>> CommitDate: Thu Jun 20 17:57:00 2013 +0200
>>
>>     hw_breakpoint: Fix cpu check in task_bp_pinned(cpu)
>>
>>     trinity fuzzer triggered WARN_ONCE("Can't find any breakpoint
>>     slot") in arch_install_hw_breakpoint() but the problem is not
>>     arch-specific.
>>
>>     The problem is, task_bp_pinned(cpu) checks "cpu == iter->cpu"
>>     but this doesn't account the "all cpus" events with iter->cpu <
>>     0.
>>
>>     This means that, say, register_user_hw_breakpoint(tsk) can
>>     happily create the arbitrary number > HBP_NUM of breakpoints
>>     which can not be activated. toggle_bp_task_slot() is equally
>>     wrong by the same reason and nr_task_bp_pinned[] can have
>>     negative entries.
>>
>>     Simple test:
>>
>>     	# perl -e 'sleep 1 while 1' &
>>     	# perf record -e mem:0x10,mem:0x10,mem:0x10,mem:0x10,mem:0x10 -p `pidof perl`
>>
>>     Before this patch this triggers the same problem/WARN_ON(),
>>     after the patch it correctly fails with -ENOSPC.
>>
>>     Reported-by: Vince Weaver <vincent.weaver@maine.edu>
>>     Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>>     Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
>>     Cc: <stable@vger.kernel.org>
>>     Link: http://lkml.kernel.org/r/20130620155006.GA6324(a)redhat.com
>>     Signed-off-by: Ingo Molnar <mingo@kernel.org>
>>
>> +-----------------------------------------------------------------------+------------+------------+------------------+
>> |                                                                       | 003002e04e | 8b4d801b2b | v3.17-rc7_093000 |
>> +-----------------------------------------------------------------------+------------+------------+------------------+
>> | boot_successes                                                        | 60         | 0          | 0                |
>> | boot_failures                                                         | 0          | 20         | 11               |
>> | WARNING:at_kernel/trace/trace_kprobe.c:kprobe_trace_self_tests_init() | 0          | 20         | 11               |
>> | backtrace:kprobe_trace_self_tests_init                                | 0          | 20         | 11               |
>> | backtrace:warn_slowpath_null                                          | 0          | 20         | 11               |
>> | backtrace:kernel_init_freeable                                        | 0          | 20         | 11               |
>> +-----------------------------------------------------------------------+------------+------------+------------------+
>>
>> [    4.188679] Testing kprobe tracing:
>> [    4.189810] Could not insert probe at kprobe_trace_selftest_target+0: -22
> 
> __register_trace_kprobe() fails.
> 
> No, I am very sure this can't be caused by the commit above. If nothing else,
> task_bp_pinned() changed by this commit is not even called in this case.

Uh, right. I'm trying to reproduce this to analyze...

Anyway, I'd like to remove the whole of kprobe_trace selftest from the
kernel binary. Instead of that, we already have ftracetest scripts.
We can run the test after the kernel booted.

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt(a)hitachi.com



WARNING: multiple messages have this Message-ID (diff)
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
	Ingo Molnar <mingo@kernel.org>, Jet Chen <jet.chen@intel.com>,
	Su Tao <tao.su@intel.com>, Yuanhan Liu <yuanhan.liu@intel.com>,
	LKP <lkp@01.org>,
	linux-kernel@vger.kernel.org
Subject: Re: Re: [hw_breakpoint] WARNING: at kernel/trace/trace_kprobe.c:1393 kprobe_trace_self_tests_init()
Date: Wed, 01 Oct 2014 11:18:48 +0900	[thread overview]
Message-ID: <542B6488.9090902@hitachi.com> (raw)
In-Reply-To: <20140930175844.GA20922@redhat.com>

(2014/10/01 2:58), Oleg Nesterov wrote:
> Hi Fengguang,
> 
> On 09/30, Fengguang Wu wrote:
>>
>> Hi Oleg,
>>
>> 0day kernel testing robot got the below dmesg and the first bad commit is
>>
>> commit 8b4d801b2b123b6c09742f861fe44a8527b84d47
>> Author:     Oleg Nesterov <oleg@redhat.com>
>> AuthorDate: Thu Jun 20 17:50:06 2013 +0200
>> Commit:     Ingo Molnar <mingo@kernel.org>
>> CommitDate: Thu Jun 20 17:57:00 2013 +0200
>>
>>     hw_breakpoint: Fix cpu check in task_bp_pinned(cpu)
>>
>>     trinity fuzzer triggered WARN_ONCE("Can't find any breakpoint
>>     slot") in arch_install_hw_breakpoint() but the problem is not
>>     arch-specific.
>>
>>     The problem is, task_bp_pinned(cpu) checks "cpu == iter->cpu"
>>     but this doesn't account the "all cpus" events with iter->cpu <
>>     0.
>>
>>     This means that, say, register_user_hw_breakpoint(tsk) can
>>     happily create the arbitrary number > HBP_NUM of breakpoints
>>     which can not be activated. toggle_bp_task_slot() is equally
>>     wrong by the same reason and nr_task_bp_pinned[] can have
>>     negative entries.
>>
>>     Simple test:
>>
>>     	# perl -e 'sleep 1 while 1' &
>>     	# perf record -e mem:0x10,mem:0x10,mem:0x10,mem:0x10,mem:0x10 -p `pidof perl`
>>
>>     Before this patch this triggers the same problem/WARN_ON(),
>>     after the patch it correctly fails with -ENOSPC.
>>
>>     Reported-by: Vince Weaver <vincent.weaver@maine.edu>
>>     Signed-off-by: Oleg Nesterov <oleg@redhat.com>
>>     Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
>>     Cc: <stable@vger.kernel.org>
>>     Link: http://lkml.kernel.org/r/20130620155006.GA6324@redhat.com
>>     Signed-off-by: Ingo Molnar <mingo@kernel.org>
>>
>> +-----------------------------------------------------------------------+------------+------------+------------------+
>> |                                                                       | 003002e04e | 8b4d801b2b | v3.17-rc7_093000 |
>> +-----------------------------------------------------------------------+------------+------------+------------------+
>> | boot_successes                                                        | 60         | 0          | 0                |
>> | boot_failures                                                         | 0          | 20         | 11               |
>> | WARNING:at_kernel/trace/trace_kprobe.c:kprobe_trace_self_tests_init() | 0          | 20         | 11               |
>> | backtrace:kprobe_trace_self_tests_init                                | 0          | 20         | 11               |
>> | backtrace:warn_slowpath_null                                          | 0          | 20         | 11               |
>> | backtrace:kernel_init_freeable                                        | 0          | 20         | 11               |
>> +-----------------------------------------------------------------------+------------+------------+------------------+
>>
>> [    4.188679] Testing kprobe tracing:
>> [    4.189810] Could not insert probe at kprobe_trace_selftest_target+0: -22
> 
> __register_trace_kprobe() fails.
> 
> No, I am very sure this can't be caused by the commit above. If nothing else,
> task_bp_pinned() changed by this commit is not even called in this case.

Uh, right. I'm trying to reproduce this to analyze...

Anyway, I'd like to remove the whole of kprobe_trace selftest from the
kernel binary. Instead of that, we already have ftracetest scripts.
We can run the test after the kernel booted.

Thank you,

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  reply	other threads:[~2014-10-01  2:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30  7:43 [hw_breakpoint] WARNING: at kernel/trace/trace_kprobe.c:1393 kprobe_trace_self_tests_init() Fengguang Wu
2014-09-30  7:43 ` Fengguang Wu
2014-09-30 17:58 ` Oleg Nesterov
2014-09-30 17:58   ` Oleg Nesterov
2014-10-01  2:18   ` Masami Hiramatsu [this message]
2014-10-01  2:18     ` Masami Hiramatsu
2014-10-01  6:57   ` Fengguang Wu
2014-10-01  6:57     ` Fengguang Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542B6488.9090902@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=lkp@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.