TencentOS-kernel/arch
Michael Neuling e3070fd628 powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation
commit 1da4a0272c5469169f78cd76cf175ff984f52f06 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: 5080332c2c89 ("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>
2021-03-16 16:40:06 +08:00
..
alpha alpha: fix annotation of io{read,write}{16,32}be() 2021-03-16 16:34:34 +08:00
arc ARC: [dts] fix the errors detected by dtbs_check 2021-03-16 16:39:49 +08:00
arm ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node 2021-03-16 16:39:53 +08:00
arm64 arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes 2021-03-16 16:39:52 +08:00
c6x Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
csky csky: Fixup abiv2 syscall_trace break a4 & a5 2021-03-16 16:28:56 +08:00
h8300 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hexagon hexagon: define ioremap_uc 2021-03-16 16:27:29 +08:00
ia64 ia64: kprobes: Use generic kretprobe trampoline handler 2021-03-16 16:39:45 +08:00
m68k m68k: q40: Fix info-leak in rtc_ioctl 2021-03-16 16:36:33 +08:00
microblaze Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
mips MIPS: DEC: Restore bootmem reservation for firmware working memory area 2021-03-16 16:40:05 +08:00
nds32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nios2 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
openrisc openrisc: Fix issue with get_user for 64-bit values 2021-03-16 16:39:36 +08:00
parisc kbuild: fix broken builds because of GZIP,BZIP2,LZOP variables 2021-03-16 16:35:20 +08:00
powerpc powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation 2021-03-16 16:40:06 +08:00
riscv riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO 2021-03-16 16:39:46 +08:00
s390 s390/stp: add locking to sysfs functions 2021-03-16 16:40:05 +08:00
sh sh: landisk: Add missing initialization of sh_io_port_base 2021-03-16 16:34:22 +08:00
sparc sparc64: remove mm_cpumask clearing to fix kthread_use_mm race 2021-03-16 16:39:40 +08:00
um um: change sigio_spinlock to a mutex 2021-03-16 16:39:41 +08:00
unicore32 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
x86 perf/x86/amd/ibs: Fix raw sample data accumulation 2021-03-16 16:39:55 +08:00
xtensa xtensa: fix system_call interaction with ptrace 2021-03-16 16:36:42 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race 2021-03-16 16:39:40 +08:00