linux/arch/powerpc
Nathan Lynch fb768e0571 powerpc/pseries/papr-sysparm: Validate buffer object lengths
[ Upstream commit 35aae182bd ]

The ability to get and set system parameters will be exposed to user
space, so let's get a little more strict about malformed
papr_sysparm_buf objects.

* Create accessors for the length field of struct papr_sysparm_buf.
  The length is always stored in MSB order and this is better than
  spreading the necessary conversions all over.

* Reject attempts to submit invalid buffers to RTAS.

* Warn if RTAS returns a buffer with an invalid length, clamping the
  returned length to a safe value that won't overrun the buffer.

These are meant as precautionary measures to mitigate both firmware
and kernel bugs in this area, should they arise, but I am not aware of
any.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231212-papr-sys_rtas-vs-lockdown-v6-10-e9eafd0c8c6c@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-08-29 17:33:31 +02:00
..
boot powerpc: dts: add missing space before { 2023-08-25 08:39:30 +10:00
configs powerpc/configs: Update defconfig with now user-visible CONFIG_FSL_IFC 2024-08-03 08:53:19 +02:00
crypto powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-05-17 12:02:18 +02:00
include powerpc/topology: Check if a core is online 2024-08-29 17:33:30 +02:00
kernel powerpc/prom: Add CPU info to hardware description string later 2024-08-03 08:54:00 +02:00
kexec powerpc/pseries: Fix scv instruction crash with kexec 2024-07-11 12:49:17 +02:00
kvm powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap() 2024-08-03 08:54:38 +02:00
lib powerpc: xor_vmx: Add '-mhard-float' to CFLAGS 2024-04-03 15:28:26 +02:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/8xx: fix size given to set_huge_pte_at() 2024-08-03 08:54:10 +02:00
net Revert "powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data" 2024-07-09 11:44:29 +02:00
perf powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks 2024-03-26 18:19:54 -04:00
platforms powerpc/pseries/papr-sysparm: Validate buffer object lengths 2024-08-29 17:33:31 +02:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu 2024-08-29 17:33:30 +02:00
tools powerpc/ftrace: Add support for -fpatchable-function-entry 2023-08-22 00:09:06 +10:00
xmon powerpc/xmon: Fix disassembly CPU feature checks 2024-08-03 08:54:02 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig powerpc/64s: Increase default stack size to 32KB 2024-01-25 15:35:42 -08:00
Kconfig.debug powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y 2023-07-03 16:07:55 +10:00
Makefile powerpc/64s: Move CPU -mtune options into Kconfig 2023-08-25 08:39:29 +10:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00