From d6434e1042f3b0a6dfe1b1f615af369486f9b1fa Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 9 Oct 1999 00:00:47 +0000 Subject: Merge with 2.3.19. --- arch/ppc/mm/fault.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'arch/ppc/mm/fault.c') diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c index fde053df9..524087541 100644 --- a/arch/ppc/mm/fault.c +++ b/arch/ppc/mm/fault.c @@ -89,13 +89,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, printk("page fault in interrupt handler, addr=%lx\n", address); show_regs(regs); -#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) - if (debugger_kernel_faults) - debugger(regs); -#endif } } - if (current == NULL) { + if (current == NULL || mm == NULL) { bad_page_fault(regs, address); return; } @@ -161,6 +157,7 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address) { unsigned long fixup; + if (user_mode(regs)) { force_sig(SIGSEGV, current); return; @@ -174,11 +171,11 @@ bad_page_fault(struct pt_regs *regs, unsigned long address) /* kernel has accessed a bad area */ show_regs(regs); - print_backtrace( (unsigned long *)regs->gpr[1] ); #if defined(CONFIG_XMON) || defined(CONFIG_KGDB) if (debugger_kernel_faults) debugger(regs); #endif + print_backtrace( (unsigned long *)regs->gpr[1] ); panic("kernel access of bad area pc %lx lr %lx address %lX tsk %s/%d", regs->nip,regs->link,address,current->comm,current->pid); } -- cgit v1.2.3