[patch 08/25] Kprobe smoke test lockdep warning

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>, Peter Zijlstra <a.p.zijlstra@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, Willy Tarreau <w@...>, Rodrigo Rubira Branco <rbranco@...>, Jake Edge <jake@...>, Eugene Teo <eteo@...>, <torvalds@...>, <akpm@...>, <alan@...>, Ingo Molnar <mingo@...>, Oliver Pinter <oliver.pntr@...>, Masami Hiramatsu <mhiramat@...>
Date: Monday, August 4, 2008 - 5:30 pm

2.6.26-stable review patch.  If anyone has any objections, please let us
know.

------------------

From: Peter Zijlstra <peterz@infradead.org>

[ Upstream commit d54191b85e294c46f05a2249b1f55ae54930bcc7 ]

On Mon, 2008-04-21 at 18:54 -0400, Masami Hiramatsu wrote:
annotation.

My reply to BZ 10489:

kprobe_exceptions_notify+0x322/0x3af
do_int3+0x1d/0x7d
__do_softirq+0xfa/0x100
do_softirq+0x74/0xd9

how I love this stuff...

Ok, do_debug() is a trap, this can happen at any time regardless of the
machine's IRQ state. So the first thing we do is fix up the IRQ state.
Then we call this die notifier stuff; and return with messed up IRQ
state... YAY.

So, kprobes fudges it..

  notify_die(DIE_DEBUG)
    kprobe_exceptions_notify()
      post_kprobe_handler()
        modify regs->flags
        trace_hardirqs_fixup_flags(regs->flags);  <--- must be it

So what's the use of modifying flags if they're not meant to take effect
at some point.

/me tries to reproduce issue; enable kprobes test thingy && boot

OK, that reproduces..

So the below makes it work - but I'm not getting this code; at the time
I wrote that stuff I CC'ed each and every kprobe maintainer listed in
the usual places but got no reposonse - can some please explain this
stuff to me?

Are the saved flags only for the TF bit or are they made in full effect
later (and if so, where) ?

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
CC: Oliver Pinter <oliver.pntr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/kprobes.c |    1 -
 1 file changed, 1 deletion(-)

--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -860,7 +860,6 @@ static int __kprobes post_kprobe_handler
 
 	resume_execution(cur, regs, kcb);
 	regs->flags |= kcb->kprobe_saved_flags;
-	trace_hardirqs_fixup_flags(regs->flags);
 
 	if ((kcb->kprobe_status != KPROBE_REENTER) && cur->post_handler) {
 		kcb->kprobe_status = KPROBE_HIT_SSDONE;

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/25] 2.6.26-stable review, Greg KH, (Mon Aug 4, 5:27 pm)
[patch 25/25] Ath5k: kill tasklets on shutdown, Greg KH, (Mon Aug 4, 5:30 pm)
[patch 24/25] Ath5k: fix memory corruption, Greg KH, (Mon Aug 4, 5:30 pm)
[patch 11/25] SCSI: ch: fix ch_remove oops, Greg KH, (Mon Aug 4, 5:30 pm)
[patch 08/25] Kprobe smoke test lockdep warning, Greg KH, (Mon Aug 4, 5:30 pm)
[patch 07/25] Close race in md_probe, Greg KH, (Mon Aug 4, 5:29 pm)
Re: [patch 01/25] ftrace: remove unneeded documentation, Steven Rostedt, (Mon Aug 4, 5:42 pm)
Re: [patch 01/25] ftrace: remove unneeded documentation, Steven Rostedt, (Mon Aug 4, 6:02 pm)
Re: [patch 01/25] ftrace: remove unneeded documentation, Steven Rostedt, (Mon Aug 4, 6:16 pm)