From: Helge Deller Date: Thu, 8 Jun 2017 20:06:54 +0000 (+0200) Subject: parisc: Avoid zeroing gr[0] in fixup_exception() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b752c7b20709e0ecee0f7d4ef6ef82fcc27408b6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git parisc: Avoid zeroing gr[0] in fixup_exception() 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 --- diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index fdc34cf4eb0e..41448f7b2b2a 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c @@ -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; } }