linux/arch/powerpc
Nathan Lynch e7582edb78 powerpc/rtas: Move token validation from block_rtas_call() to sys_rtas()
The rtas system call handler sys_rtas() delegates certain input
validation steps to a helper function: block_rtas_call(). One of these
steps ensures that the user-supplied token value maps to a known RTAS
function. This is done by performing a "reverse" token-to-function
lookup via rtas_token_to_function_untrusted() to obtain an
rtas_function object.

In changes to come, sys_rtas() itself will need the function
descriptor for the token. To prepare:

* Move the lookup and validation up into sys_rtas() and pass the
  resulting rtas_function pointer to block_rtas_call(), which is
  otherwise unconcerned with the token value.

* Change block_rtas_call() to report the RTAS function name instead of
  the token value on validation failures, since it can now rely on
  having a valid function descriptor.

One behavior change is that sys_rtas() now silently errors out when
passed a bad token, before calling block_rtas_call(). So we will no
longer log "RTAS call blocked - exploit attempt?" on invalid
tokens. This is consistent with how sys_rtas() currently handles other
"metadata" (nargs and nret), while block_rtas_call() is primarily
concerned with validating the arguments to be passed to specific RTAS
functions.

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-5-e9eafd0c8c6c@linux.ibm.com
2023-12-13 21:38:20 +11:00
..
boot powerpc/boot: Add version to install filenames 2023-10-20 17:34:26 +11:00
configs powerpc/configs/64s: Enable CONFIG_MEM_SOFT_DIRTY 2023-11-27 22:01:14 +11:00
crypto This push fixes a random config build failure on powerpc. 2023-09-01 15:39:25 -07:00
include powerpc/rtas: Add function return status constants 2023-12-13 21:38:20 +11:00
kernel powerpc/rtas: Move token validation from block_rtas_call() to sys_rtas() 2023-12-13 21:38:20 +11:00
kexec powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
kvm powerpc: Add PVN support for HeXin C2000 processor 2023-12-01 21:15:33 +11:00
lib powerpc/lib: Validate size for vector operations 2023-11-27 22:06:19 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/book3s/hash: Drop _PAGE_PRIVILEGED from PAGE_NONE 2023-12-07 23:34:11 +11:00
net powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] 2023-10-23 20:33:19 +11:00
perf powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function 2023-12-13 21:05:03 +11:00
platforms powerpc/pseries/memhp: Log more error conditions in add path 2023-12-01 21:15:34 +11: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 2023-11-27 22:01:15 +11:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
Kbuild
Kconfig powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API 2023-10-20 17:55:56 +11:00
Kconfig.debug powerpc/ps3: move udbg_shutdown_ps3gelic prototype 2023-11-21 12:06:50 +11:00
Makefile powerpc/Makefile: Auto detect cross compiler 2023-12-07 23:34:38 +11:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00