diff options
author | 2024-03-25 16:28:15 +1100 | |
---|---|---|
committer | 2024-05-08 00:35:42 +1000 | |
commit | c3710ee7cd695dc1b0b4b8cfbf464e313467f970 (patch) | |
tree | 28ec95cd53817160e1a24fa032da55b2bd71fe6b /tools/perf/scripts/python/export-to-postgresql.py | |
parent | powerpc/code-patching: Test patch_instructions() during boot (diff) | |
download | wireguard-linux-c3710ee7cd695dc1b0b4b8cfbf464e313467f970.tar.xz wireguard-linux-c3710ee7cd695dc1b0b4b8cfbf464e313467f970.zip |
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
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions