summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2012-08-10 12:21:15 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-21 09:27:57 -0700
commitfb2ca533f518dabf814c6aab3b7ce3c236959a68 (patch)
tree363a7aa5a517a9c2e6e1ab273811b7c40ba2df31 /arch
parent531db9f3addc4664300aa14af6130f160150970f (diff)
downloadlinux-3.10-fb2ca533f518dabf814c6aab3b7ce3c236959a68.tar.gz
linux-3.10-fb2ca533f518dabf814c6aab3b7ce3c236959a68.tar.bz2
linux-3.10-fb2ca533f518dabf814c6aab3b7ce3c236959a68.zip
mips,kgdb: fix recursive page fault with CONFIG_KPROBES
commit f0a996eeeda214f4293e234df33b29bec003b536 upstream. This fault was detected using the kgdb test suite on boot and it crashes recursively due to the fact that CONFIG_KPROBES on mips adds an extra die notifier in the page fault handler. The crash signature looks like this: kgdbts:RUN bad memory access test KGDB: re-enter exception: ALL breakpoints killed Call Trace: [<807b7548>] dump_stack+0x20/0x54 [<807b7548>] dump_stack+0x20/0x54 The fix for now is to have kgdb return immediately if the fault type is DIE_PAGE_FAULT and allow the kprobe code to decide what is supposed to happen. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kernel/kgdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index f4546e97c60..23817a6e32b 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -283,6 +283,15 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
struct pt_regs *regs = args->regs;
int trap = (regs->cp0_cause & 0x7c) >> 2;
+#ifdef CONFIG_KPROBES
+ /*
+ * Return immediately if the kprobes fault notifier has set
+ * DIE_PAGE_FAULT.
+ */
+ if (cmd == DIE_PAGE_FAULT)
+ return NOTIFY_DONE;
+#endif /* CONFIG_KPROBES */
+
/* Userspace events, ignore. */
if (user_mode(regs))
return NOTIFY_DONE;