* [PATCH] parisc: Avoid zeroing register 0 in fixup_exception()
@ 2017-06-08 20:06 Helge Deller
0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2017-06-08 20:06 UTC (permalink / raw)
To: linux-parisc, James Bottomley, John David Anglin
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>
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index 32ec221..e683b7f 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -163,6 +163,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;
}
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-08 20:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08 20:06 [PATCH] parisc: Avoid zeroing register 0 in fixup_exception() Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox