diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2012-08-10 13:21:15 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2012-10-12 07:37:34 -0400 |
commit | f0a996eeeda214f4293e234df33b29bec003b536 (patch) | |
tree | 0e99211ea48768a0bf9a9590861a24640cc50ea6 /arch/mips | |
parent | f30fed10c440a25937e509860fa207399b26efe5 (diff) |
mips,kgdb: fix recursive page fault with CONFIG_KPROBES
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.
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/kgdb.c | 9 |
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, | |||
283 | struct pt_regs *regs = args->regs; | 283 | struct pt_regs *regs = args->regs; |
284 | int trap = (regs->cp0_cause & 0x7c) >> 2; | 284 | int trap = (regs->cp0_cause & 0x7c) >> 2; |
285 | 285 | ||
286 | #ifdef CONFIG_KPROBES | ||
287 | /* | ||
288 | * Return immediately if the kprobes fault notifier has set | ||
289 | * DIE_PAGE_FAULT. | ||
290 | */ | ||
291 | if (cmd == DIE_PAGE_FAULT) | ||
292 | return NOTIFY_DONE; | ||
293 | #endif /* CONFIG_KPROBES */ | ||
294 | |||
286 | /* Userspace events, ignore. */ | 295 | /* Userspace events, ignore. */ |
287 | if (user_mode(regs)) | 296 | if (user_mode(regs)) |
288 | return NOTIFY_DONE; | 297 | return NOTIFY_DONE; |