diff options
author | Alex Shi <alex.shi@linaro.org> | 2016-07-01 14:35:28 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2016-07-01 14:35:28 +0800 |
commit | f8749d04e26aa003ad75cb2ab371bc562eb56231 (patch) | |
tree | 4aa16a1a9d5043e4d22f8cabe98dcf3bfa93e6fc /arch/parisc/kernel/unaligned.c | |
parent | ff6d469851b0e93dacbca9b56f9d1b903180a3fd (diff) | |
parent | 439863d92fda525a8f3b326a24490e91c70f0496 (diff) |
Merge branch 'linux-linaro-lsk-v4.1' into linux-linaro-lsk-v4.1-androidlsk-v4.1-16.06-android
Diffstat (limited to 'arch/parisc/kernel/unaligned.c')
-rw-r--r-- | arch/parisc/kernel/unaligned.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index d7c0acb35ec2..8d49614d600d 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -666,7 +666,7 @@ void handle_unaligned(struct pt_regs *regs) break; } - if (modify && R1(regs->iir)) + if (ret == 0 && modify && R1(regs->iir)) regs->gr[R1(regs->iir)] = newbase; @@ -677,6 +677,14 @@ void handle_unaligned(struct pt_regs *regs) if (ret) { + /* + * The unaligned handler failed. + * If we were called by __get_user() or __put_user() jump + * to it's exception fixup handler instead of crashing. + */ + if (!user_mode(regs) && fixup_exception(regs)) + return; + printk(KERN_CRIT "Unaligned handler failed, ret = %d\n", ret); die_if_kernel("Unaligned data reference", regs, 28); |