parisc: Avoid zeroing gr[0] in fixup_exception()
authorHelge Deller <deller@gmx.de>
Thu, 8 Jun 2017 20:06:54 +0000 (22:06 +0200)
committerHelge Deller <deller@gmx.de>
Fri, 9 Jun 2017 09:34:53 +0000 (11:34 +0200)
Register gr[0] holds the PSW in interrupt context. It's absolutely
unlikely that the compiler will use register zero in a get_user() call,
but better BUG on such a case in fixup_exception() anyway.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/mm/fault.c

index fdc34cf4eb0ee06f2653d858cda1f7560a2089b0..41448f7b2b2a089a2ea31c52befc26b87bb111ac 100644 (file)
@@ -154,6 +154,7 @@ int fixup_exception(struct pt_regs *regs)
                        /* zero target register for get_user() */
                        if (parisc_acctyp(0, regs->iir) == VM_READ) {
                                int treg = regs->iir & 0x1f;
+                               BUG_ON(treg == 0);
                                regs->gr[treg] = 0;
                        }
                }