linux/arch
Michael Neuling ed596114fd 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:08:51 +01:00
..
alpha alpha: fix annotation of io{read,write}{16,32}be() 2020-08-26 10:31:02 +02:00
arc arc: plat-hsdk: fix kconfig dependency warning when !RESET_CONTROLLER 2020-10-29 09:55:17 +01:00
arm ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node 2020-11-05 11:08:45 +01:00
arm64 arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes 2020-11-05 11:08:44 +01:00
c6x
h8300
hexagon hexagon: define ioremap_uc 2020-05-10 10:30:11 +02:00
ia64 ia64: kprobes: Use generic kretprobe trampoline handler 2020-11-05 11:08:41 +01:00
m68k m68k: q40: Fix info-leak in rtc_ioctl 2020-10-01 13:14:24 +02:00
microblaze microblaze: Prevent the overflow of the start 2020-02-24 08:34:53 +01:00
mips MIPS: Add the missing 'CPU_1074K' into __get_cpu_type() 2020-10-01 13:14:53 +02:00
nds32 nds32: Fix the items of hwcap_str ordering issue. 2019-12-13 08:51:35 +01:00
nios2 nios2: ksyms: Add missing symbol exports 2020-01-27 14:50:30 +01:00
openrisc openrisc: Fix cache API compile issue when not inlining 2020-09-23 12:10:58 +02:00
parisc parisc: Implement __smp_store_release and __smp_load_acquire barriers 2020-08-19 08:15:07 +02:00
powerpc powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation 2020-11-05 11:08:51 +01:00
riscv riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO 2020-11-05 11:08:41 +01:00
s390 s390/stp: add locking to sysfs functions 2020-11-05 11:08:51 +01:00
sh sh: landisk: Add missing initialization of sh_io_port_base 2020-08-21 11:05:39 +02:00
sparc sparc64: remove mm_cpumask clearing to fix kthread_use_mm race 2020-11-05 11:08:38 +01:00
um um: change sigio_spinlock to a mutex 2020-11-05 11:08:39 +01:00
unicore32
x86 perf/x86/amd/ibs: Fix raw sample data accumulation 2020-11-05 11:08:46 +01:00
xtensa xtensa: fix xtensa_pmu_setup prototype 2020-08-21 11:05:31 +02:00
.gitignore
Kconfig mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race 2020-11-05 11:08:38 +01:00