This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Re: [PATCH -tip v8 01/26] [BUGFIX]kprobes/x86: Fix page-fault handling logic
- From: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>
- To: Steven Rostedt <rostedt at goodmis dot org>
- Cc: linux-kernel at vger dot kernel dot org, Ingo Molnar <mingo at kernel dot org>, Andi Kleen <andi at firstfloor dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Sandeepa Prabhu <sandeepa dot prabhu at linaro dot org>, Frederic Weisbecker <fweisbec at gmail dot com>, x86 at kernel dot org, fche at redhat dot com, mingo at redhat dot com, systemtap at sourceware dot org, "H. Peter Anvin" <hpa at zytor dot com>, Thomas Gleixner <tglx at linutronix dot de>
- Date: Mon, 24 Mar 2014 10:10:16 +0900
- Subject: Re: Re: [PATCH -tip v8 01/26] [BUGFIX]kprobes/x86: Fix page-fault handling logic
- Authentication-results: sourceware.org; auth=none
- References: <20140305115843 dot 22766 dot 8355 dot stgit at ltc230 dot yrl dot intra dot hitachi dot co dot jp> <20140305115850 dot 22766 dot 13456 dot stgit at ltc230 dot yrl dot intra dot hitachi dot co dot jp> <20140321173922 dot 76348fdd at gandalf dot local dot home>
(2014/03/22 6:39), Steven Rostedt wrote:
>> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
>> index 79a3f96..b482e96 100644
>> --- a/arch/x86/kernel/kprobes/core.c
>> +++ b/arch/x86/kernel/kprobes/core.c
>> @@ -897,9 +897,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
>> struct kprobe *cur = kprobe_running();
>> struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
>>
>> - switch (kcb->kprobe_status) {
>> - case KPROBE_HIT_SS:
>> - case KPROBE_REENTER:
>> + if (unlikely(regs->ip == (unsigned long)cur->ainsn.insn)) {
>
> I wonder if we should add a:
>
> WARN_ON(kcb->kprobe_status != KPROBE_HIT_SS &&
> kcb->kprobe_status != KPROBE_REENTER);
Ah, right. I'll add it for verifying the status.
Thanks!
--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com