1
0
Fork 0
alistair23-linux/arch/arm64
Fredrik Strupe 20a62e9073 arm64: armv8_deprecated: Fix undef_hook mask for thumb setend
commit fc2266011a upstream.

For thumb instructions, call_undef_hook() in traps.c first reads a u16,
and if the u16 indicates a T32 instruction (u16 >= 0xe800), a second
u16 is read, which then makes up the the lower half-word of a T32
instruction. For T16 instructions, the second u16 is not read,
which makes the resulting u32 opcode always have the upper half set to
0.

However, having the upper half of instr_mask in the undef_hook set to 0
masks out the upper half of all thumb instructions - both T16 and T32.
This results in trapped T32 instructions with the lower half-word equal
to the T16 encoding of setend (b650) being matched, even though the upper
half-word is not 0000 and thus indicates a T32 opcode.

An example of such a T32 instruction is eaa0b650, which should raise a
SIGILL since T32 instructions with an eaa prefix are unallocated as per
Arm ARM, but instead works as a SETEND because the second half-word is set
to b650.

This patch fixes the issue by extending instr_mask to include the
upper u32 half, which will still match T16 instructions where the upper
half is 0, but not T32 instructions.

Fixes: 2d888f48e0 ("arm64: Emulate SETEND for AArch32 tasks")
Cc: <stable@vger.kernel.org> # 4.0.x-
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Fredrik Strupe <fredrik@strupe.net>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-17 10:50:19 +02:00
..
boot arm64: dts: ti: k3-am65: Add clocks to dwc3 nodes 2020-04-17 10:50:19 +02:00
configs arm64/ARM: configs: Change CONFIG_REMOTEPROC from m to y 2019-09-30 11:48:00 -07:00
crypto crypto: arm64/ghash-neon - bump priority to 150 2020-02-11 04:35:31 -08:00
include arm64: alternative: fix build with clang integrated assembler 2020-04-02 15:11:02 +02:00
kernel arm64: armv8_deprecated: Fix undef_hook mask for thumb setend 2020-04-17 10:50:19 +02:00
kvm arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly 2020-02-14 16:34:18 -05:00
lib arm64: uaccess: Remove uaccess_*_not_uao asm macros 2019-11-20 18:51:54 +00:00
mm arm64: Revert support for execute-only user mappings 2020-01-09 10:20:01 +01:00
net arm64: bpf: optimize modulo operation 2019-09-03 15:44:40 +02:00
xen xen/efi: have a common runtime setup function 2019-10-02 10:31:07 -04:00
Kbuild arm64: add arch/arm64/Kbuild 2019-08-21 18:47:15 +01:00
Kconfig arm64: Implement copy_thread_tls 2020-01-14 20:08:34 +01:00
Kconfig.debug treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.platforms arm64: exynos: Enable exynos-chipid driver 2019-09-04 22:43:26 +02:00
Makefile arm64: Kconfig: Make CONFIG_COMPAT_VDSO a proper Kconfig option 2019-10-07 13:32:15 +01:00