linux/arch/powerpc
Benjamin Gray c3710ee7cd powerpc/code-patching: Use dedicated memory routines for patching
The patching page set up as a writable alias may be in quadrant 0
(userspace) if the temporary mm path is used. This causes sanitiser
failures if so. Sanitiser failures also occur on the non-mm path
because the plain memset family is instrumented, and KASAN treats the
patching window as poisoned.

Introduce locally defined patch_* variants of memset that perform an
uninstrumented lower level set, as well as detecting write errors like
the original single patch variant does.

copy_to_user() is not correct here, as the PTE makes it a proper kernel
page (the EAA is privileged access only, RW). It just happens to be in
quadrant 0 because that's the hardware's mechanism for using the current
PID vs PID 0 in translations. Importantly, it's incorrect to allow user
page accesses.

Now that the patching memsets are used, we also propagate a failure up
to the caller as the single patch variant does.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240325052815.854044-2-bgray@linux.ibm.com
2024-05-08 00:35:42 +10:00
..
boot powerpc: Fix typos 2024-05-08 00:21:30 +10:00
configs powerpc: Add allmodconfig for all 32-bit sub-arches 2024-03-03 22:20:29 +11:00
crypto crypto: vmx - Move to arch/powerpc/crypto 2024-01-26 16:36:57 +08:00
include powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX 2024-05-08 00:25:00 +10:00
kernel powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX 2024-05-08 00:25:00 +10:00
kexec powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency 2024-03-17 13:34:00 +11:00
kvm powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX 2024-05-08 00:25:00 +10:00
lib powerpc/code-patching: Use dedicated memory routines for patching 2024-05-08 00:35:42 +10:00
math-emu
mm powerpc64/kasan: Pass virtual addresses to kasan_init_phys_region() 2024-05-08 00:28:16 +10:00
net powerpc/bpf/32: Fix failing test_bpf tests 2024-05-07 22:17:02 +10:00
perf powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks 2024-03-03 23:05:21 +11:00
platforms powerpc: rename SPRN_HID2 define to SPRN_HID2_750FX 2024-05-08 00:25:00 +10:00
purgatory
sysdev powerpc: Fix typos 2024-05-08 00:21:30 +10:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon powerpc/Makefile: Remove bits related to the previous use of -mcmodel=large 2024-05-07 23:48:45 +10:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency 2024-03-17 13:34:00 +11:00
Kconfig.debug powerpc/ps3: move udbg_shutdown_ps3gelic prototype 2023-11-21 12:06:50 +11:00
Makefile powerpc/Makefile: Remove bits related to the previous use of -mcmodel=large 2024-05-07 23:48:45 +10:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00