diff options
author | Kyle McMartin <kyle@mcmartin.ca> | 2008-12-19 21:29:06 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@mcmartin.ca> | 2009-01-05 14:16:46 -0500 |
commit | c61c25eb02757ecf697015ef4ae3675c5e114e2e (patch) | |
tree | db955b3bcd10a69dbb68366203ee0d6b64cbfe3d /arch/parisc/kernel/traps.c | |
parent | aefa8b6bf48fdcc904de4f166e59ab37fb750dec (diff) |
parisc: fix kernel crash (protection id trap) when compiling ruby1.9
On Wed, Dec 17, 2008 at 11:46:05PM +0100, Helge Deller wrote:
>
Honestly, I can't decide whether to apply this. It really should never
happen in the kernel, since the kernel can guarantee it won't get the
access rights failure (highest privilege level, and can set %sr and
%protid to whatever it wants.)
It really genuinely is a bug that probably should panic the kernel. The
only precedent I can easily see is x86 fixing up a bad iret with a
general protection fault, which is more or less analogous to code 27
here.
On the other hand, taking the exception on a userspace access really
isn't all that critical, and there's fundamentally little reason for the
kernel not to SIGSEGV the process, and continue...
Argh.
(btw, I've instrumented my do_sys_poll with a pile of assertions that
%cr8 << 1 == %sr3 == current->mm.context... let's see if where we're
getting corrupted is deterministic, though, I would guess that it won't
be.)
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/parisc/kernel/traps.c')
-rw-r--r-- | arch/parisc/kernel/traps.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 4c771cd580ec..548ba0c654d2 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -745,6 +745,10 @@ void handle_interruption(int code, struct pt_regs *regs) | |||
745 | /* Fall Through */ | 745 | /* Fall Through */ |
746 | case 27: | 746 | case 27: |
747 | /* Data memory protection ID trap */ | 747 | /* Data memory protection ID trap */ |
748 | if (code == 27 && !user_mode(regs) && | ||
749 | fixup_exception(regs)) | ||
750 | return; | ||
751 | |||
748 | die_if_kernel("Protection id trap", regs, code); | 752 | die_if_kernel("Protection id trap", regs, code); |
749 | si.si_code = SEGV_MAPERR; | 753 | si.si_code = SEGV_MAPERR; |
750 | si.si_signo = SIGSEGV; | 754 | si.si_signo = SIGSEGV; |