summaryrefslogtreecommitdiffstats
path: root/arch/parisc/mm/fault.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-04-20 16:05:13 +0200
committerThomas Gleixner <tglx@linutronix.de>2017-04-20 16:05:13 +0200
commit7a258ff04f9d5fe549fed6d03931a0236587047e (patch)
tree6b164332c2a3983d972cc4dc47af3fce6cc5dc32 /arch/parisc/mm/fault.c
parent382bd4de61827dbaaf5fb4fb7b1f4be4a86505e7 (diff)
parentf61143c45077df4fa78e2f1ba455a00bbe1d5b8c (diff)
downloadop-kernel-dev-7a258ff04f9d5fe549fed6d03931a0236587047e.zip
op-kernel-dev-7a258ff04f9d5fe549fed6d03931a0236587047e.tar.gz
Merge branch 'linus' into irq/core
Pick up upstream fixes to avoid conflicts with pending patches.
Diffstat (limited to 'arch/parisc/mm/fault.c')
-rw-r--r--arch/parisc/mm/fault.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index deab89a..32ec221 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -150,6 +150,23 @@ int fixup_exception(struct pt_regs *regs)
d->fault_space = regs->isr;
d->fault_addr = regs->ior;
+ /*
+ * Fix up get_user() and put_user().
+ * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() sets the least-significant
+ * bit in the relative address of the fixup routine to indicate
+ * that %r8 should be loaded with -EFAULT to report a userspace
+ * access error.
+ */
+ if (fix->fixup & 1) {
+ regs->gr[8] = -EFAULT;
+
+ /* zero target register for get_user() */
+ if (parisc_acctyp(0, regs->iir) == VM_READ) {
+ int treg = regs->iir & 0x1f;
+ regs->gr[treg] = 0;
+ }
+ }
+
regs->iaoq[0] = (unsigned long)&fix->fixup + fix->fixup;
regs->iaoq[0] &= ~3;
/*
OpenPOWER on IntegriCloud