summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/pgtable.py
diff options
context:
space:
mode:
authorBenjamin Gray <bgray@linux.ibm.com>2024-03-25 16:28:15 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2024-05-08 00:35:42 +1000
commitc3710ee7cd695dc1b0b4b8cfbf464e313467f970 (patch)
tree28ec95cd53817160e1a24fa032da55b2bd71fe6b /scripts/gdb/linux/pgtable.py
parentc5ef5e35844ad30503c49802b9d6a6c818fca886 (diff)
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 'scripts/gdb/linux/pgtable.py')
0 files changed, 0 insertions, 0 deletions