]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc: Fix DAR reporting when alignment handler faults
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Aug 2017 10:49:57 +0000 (20:49 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Sep 2017 08:57:19 +0000 (10:57 +0200)
commit87e47744e1879b1e57d428ffc5018901d7488f95
treee89902f352048b30535ee45085bee4914e90c60d
parentab1717dafd8355d3a52ec94deacf806a232ad773
powerpc: Fix DAR reporting when alignment handler faults

commit f9effe925039cf54489b5c04e0d40073bb3a123d upstream.

Anton noticed that if we fault part way through emulating an unaligned
instruction, we don't update the DAR to reflect that.

The DAR value is eventually reported back to userspace as the address
in the SEGV signal, and if userspace is using that value to demand
fault then it can be confused by us not setting the value correctly.

This patch is ugly as hell, but is intended to be the minimal fix and
back ports easily.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/align.c