Skip to content

Commit

Permalink
MIPS: Use force_sig when handling address errors.
Browse files Browse the repository at this point in the history
When init is started it is SIGNAL_UNKILLABLE.  If it were to get an
address error, we would try to send it SIGBUS, but it would be ignored
and the faulting instruction restarted.  This results in an endless
loop.

We need to use force_sig() instead so it will actually die and give us
some useful information.

Reported-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
David Daney authored and Ralf Baechle committed May 14, 2009
1 parent d0ce9a5 commit a6d5ff0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/mips/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,19 +482,19 @@ static void emulate_load_store_insn(struct pt_regs *regs,
return;

die_if_kernel("Unhandled kernel unaligned access", regs);
send_sig(SIGSEGV, current, 1);
force_sig(SIGSEGV, current);

return;

sigbus:
die_if_kernel("Unhandled kernel unaligned access", regs);
send_sig(SIGBUS, current, 1);
force_sig(SIGBUS, current);

return;

sigill:
die_if_kernel("Unhandled kernel unaligned access or invalid instruction", regs);
send_sig(SIGILL, current, 1);
force_sig(SIGILL, current);
}

asmlinkage void do_ade(struct pt_regs *regs)
Expand Down

0 comments on commit a6d5ff0

Please sign in to comment.