linux-stable/arch
Breno Leitao ebb0e13ead powerpc/ptrace: Mitigate potential Spectre v1
'regno' is directly controlled by user space, hence leading to a potential
exploitation of the Spectre variant 1 vulnerability.

On PTRACE_SETREGS and PTRACE_GETREGS requests, user space passes the
register number that would be read or written. This register number is
called 'regno' which is part of the 'addr' syscall parameter.

This 'regno' value is checked against the maximum pt_regs structure size,
and then used to dereference it, which matches the initial part of a
Spectre v1 (and Spectre v1.1) attack. The dereferenced value, then,
is returned to userspace in the GETREGS case.

This patch sanitizes 'regno' before using it to dereference pt_reg.

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2019-02-07 00:29:20 +11:00
..
alpha Kbuild late updates for v4.21 2019-01-06 16:33:10 -08:00
arc arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
arm Late reset controller changes for v5.0 2019-01-12 22:06:54 -08:00
arm64 ARM: SoC fixes 2019-01-14 10:34:14 +12:00
c6x arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
csky csky: fixup compile error with CPU 810. 2019-01-10 04:37:37 -08:00
h8300 arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
hexagon arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
ia64 arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
m68k arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
microblaze arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
mips cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
nds32 arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
nios2 arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
openrisc arch/openrisc: Fix issues with access_ok() 2019-01-08 18:22:30 -08:00
parisc arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
powerpc powerpc/ptrace: Mitigate potential Spectre v1 2019-02-07 00:29:20 +11:00
riscv Fix a handful of audit-related issue 2019-01-07 08:45:47 -08:00
s390 Kbuild late updates for v4.21 2019-01-06 16:33:10 -08:00
sh Kbuild late updates for v4.21 2019-01-06 16:33:10 -08:00
sparc arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
um Merge branch 'akpm' (patches from Andrew) 2019-01-05 09:16:18 -08:00
unicore32 arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
x86 KVM fixes for 5.0-rc2 2019-01-12 10:39:43 -08:00
xtensa arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00