linux/arch/arm64
James Morse 40ca0ce56d arm64: entry: SP Alignment Fault doesn't write to FAR_EL1
Comparing the arm-arm's  pseudocode for AArch64.PCAlignmentFault() with
AArch64.SPAlignmentFault() shows that SP faults don't copy the faulty-SP
to FAR_EL1, but this is where we read from, and the address we provide
to user-space with the BUS_ADRALN signal.

For user-space this value will be UNKNOWN due to the previous ERET to
user-space. If the last value is preserved, on systems with KASLR or KPTI
this will be the user-space link-register left in FAR_EL1 by tramp_exit().
Fix this to retrieve the original sp_el0 value, and pass this to
do_sp_pc_fault().

SP alignment faults from EL1 will cause us to take the fault again when
trying to store the pt_regs. This eventually takes us to the overflow
stack. Remove the ESR_ELx_EC_SP_ALIGN check as we will never make it
this far.

Fixes: 60ffc30d56 ("arm64: Exception handling")
Signed-off-by: James Morse <james.morse@arm.com>
[will: change label name and fleshed out comment]
Signed-off-by: Will Deacon <will@kernel.org>
2019-07-22 16:22:34 +01:00
..
boot ARM: Device-tree updates 2019-07-19 17:19:24 -07:00
configs ARM: SoC defconfig updates 2019-07-19 17:27:27 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-07-08 20:57:08 -07:00
include arm64: Force SSBS on context switch 2019-07-22 15:24:16 +01:00
kernel arm64: entry: SP Alignment Fault doesn't write to FAR_EL1 2019-07-22 16:22:34 +01:00
kvm ARM: 2019-07-12 15:35:14 -07:00
lib treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mm mm/memory_hotplug: allow arch_remove_memory() without CONFIG_MEMORY_HOTREMOVE 2019-07-18 17:08:06 -07:00
net arm64 updates for 5.3: 2019-07-08 09:54:55 -07:00
xen treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig RISC-V updates for v5.3 2019-07-18 12:26:59 -07:00
Kconfig.debug treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.platforms ARM: SoC platform updates 2019-07-19 17:05:08 -07:00
Makefile Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00