linux/arch/powerpc
Nathan Lynch 0974d03eb4 powerpc/rtas: Prevent Spectre v1 gadget construction in sys_rtas()
Smatch warns:

  arch/powerpc/kernel/rtas.c:1932 __do_sys_rtas() warn: potential
  spectre issue 'args.args' [r] (local cap)

The 'nargs' and 'nret' locals come directly from a user-supplied
buffer and are used as indexes into a small stack-based array and as
inputs to copy_to_user() after they are subject to bounds checks.

Use array_index_nospec() after the bounds checks to clamp these values
for speculative execution.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Reported-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240530-sys_rtas-nargs-nret-v1-1-129acddd4d89@linux.ibm.com
2024-06-28 22:28:58 +10:00
..
boot powerpc/boot: Remove all 40x platforms from boot 2024-06-28 22:28:47 +10:00
configs powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
crypto powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-04-05 00:02:18 +11:00
include powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
kernel powerpc/rtas: Prevent Spectre v1 gadget construction in sys_rtas() 2024-06-28 22:28:58 +10:00
kexec powerpc/kexec_file: fix cpus node update to FDT 2024-06-17 22:48:45 +10:00
kvm powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
lib powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
net powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH 2024-05-29 22:12:42 +10:00
perf powerpc/perf: Set cpumode flags using sample address 2024-06-17 22:47:16 +10:00
platforms powerpc/platforms: Move files from 4xx to 44x 2024-06-28 22:28:48 +10:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#" 2024-05-08 00:48:32 +10:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
Kconfig.debug powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
Makefile powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00