use force_sig when handling address errors
[openwrt/staging/florian.git] / target / linux / generic-2.6 / patches-2.6.29 / 022-mips_force_sig_address_errors.patch
1 When init is started it is SIGNAL_UNKILLABLE. If it were to get an
2 address error, we would try to send it SIGBUS, but it would be ignored
3 and the faulting instruction restarted. This results in an endless
4 loop.
5
6 We need to use force_sig() instead so it will actually die and give us
7 some useful information.
8
9 Reported-by: Florian Fainelli <florian@openwrt.org>
10
11 Signed-off-by: David Daney <ddaney@caviumnetworks.com>
12 ---
13 arch/mips/kernel/unaligned.c | 6 +++---
14 1 files changed, 3 insertions(+), 3 deletions(-)
15
16 diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
17 index bf4c4a9..67bd626 100644
18 --- a/arch/mips/kernel/unaligned.c
19 +++ b/arch/mips/kernel/unaligned.c
20 @@ -482,19 +482,19 @@ fault:
21 return;
22
23 die_if_kernel("Unhandled kernel unaligned access", regs);
24 - send_sig(SIGSEGV, current, 1);
25 + force_sig(SIGSEGV, current);
26
27 return;
28
29 sigbus:
30 die_if_kernel("Unhandled kernel unaligned access", regs);
31 - send_sig(SIGBUS, current, 1);
32 + force_sig(SIGBUS, current);
33
34 return;
35
36 sigill:
37 die_if_kernel("Unhandled kernel unaligned access or invalid instruction", regs);
38 - send_sig(SIGILL, current, 1);
39 + force_sig(SIGILL, current);
40 }
41
42 asmlinkage void do_ade(struct pt_regs *regs)
43 --
44 1.6.0.6
45