1
0
Fork 0
alistair23-linux/arch/powerpc
Michael Neuling 415043c3ec powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation
commit 1da4a0272c upstream.

__get_user_atomic_128_aligned() stores to kaddr using stvx which is a
VMX store instruction, hence kaddr must be 16 byte aligned otherwise
the store won't occur as expected.

Unfortunately when we call __get_user_atomic_128_aligned() in
p9_hmi_special_emu(), the buffer we pass as kaddr (ie. vbuf) isn't
guaranteed to be 16B aligned. This means that the write to vbuf in
__get_user_atomic_128_aligned() has the bottom bits of the address
truncated. This results in other local variables being
overwritten. Also vbuf will not contain the correct data which results
in the userspace emulation being wrong and hence undetected user data
corruption.

In the past we've been mostly lucky as vbuf has ended up aligned but
this is fragile and isn't always true. CONFIG_STACKPROTECTOR in
particular can change the stack arrangement enough that our luck runs
out.

This issue only occurs on POWER9 Nimbus <= DD2.1 bare metal.

The fix is to align vbuf to a 16 byte boundary.

Fixes: 5080332c2c ("powerpc/64s: Add workaround for P9 vector CI load issue")
Cc: stable@vger.kernel.org # v4.15+
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201013043741.743413-1-mikey@neuling.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-05 11:43:31 +01:00
..
boot powerpc/boot: Fix CONFIG_PPC_MPC52XX references 2020-08-19 08:16:17 +02:00
configs vgacon: remove software scrollback support 2020-09-17 13:47:54 +02:00
crypto treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
include powerpc/drmem: Make lmb_size 64 bit 2020-11-05 11:43:30 +01:00
kernel powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation 2020-11-05 11:43:31 +01:00
kvm KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest 2020-11-05 11:43:21 +01:00
lib powerpc: Fix __clear_user() with KUAP enabled 2020-01-04 19:18:37 +01:00
math-emu treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mm powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm 2020-10-29 09:57:49 +01:00
net powerpc/bpf: Fix tail call implementation 2019-11-02 00:32:26 +01:00
oprofile treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
perf powerpc/perf/hv-gpci: Fix starting index value 2020-10-29 09:57:51 +01:00
platforms powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP 2020-11-05 11:43:31 +01:00
purgatory treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
sysdev powerpc/icp-hv: Fix missing of_node_put() in success path 2020-10-29 09:57:46 +01:00
tools powerpc: Do not consider weak unresolved symbol relocations as bad 2020-02-24 08:37:00 +01:00
xmon powerpc/xmon: Restrict when kernel is locked down 2020-06-07 13:18:49 +02:00
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
Kconfig powerpc/rtas: Restrict RTAS requests from userspace 2020-11-05 11:43:30 +01:00
Kconfig.debug powerpc/ptdump: Only enable PPC_CHECK_WX with STRICT_KERNEL_RWX 2020-02-14 16:34:16 -05:00
Makefile powerpc: Don't add -mabi= flags when building with Clang 2020-01-04 19:18:23 +01:00
Makefile.postlink powerpc: Do not consider weak unresolved symbol relocations as bad 2020-02-24 08:37:00 +01:00