diff options
author | Russell Currey <[email protected]> | 2021-11-23 18:15:20 +1000 |
---|---|---|
committer | Michael Ellerman <[email protected]> | 2021-12-14 23:13:03 +1100 |
commit | 8734b41b3efe0fc6082c1937b0e88556c396dc96 (patch) | |
tree | e518b3299fe5134df5b6a5658dcbdd33a00926a2 /tools/perf/scripts/python | |
parent | 3dc709e518b47386e6af937eaec37bb36539edfd (diff) |
powerpc/module_64: Fix livepatching for RO modules
Livepatching a loaded module involves applying relocations through
apply_relocate_add(), which attempts to write to read-only memory when
CONFIG_STRICT_MODULE_RWX=y. Work around this by performing these
writes through the text poke area by using patch_instruction().
R_PPC_REL24 is the only relocation type generated by the kpatch-build
userspace tool or klp-convert kernel tree that I observed applying a
relocation to a post-init module.
A more comprehensive solution is planned, but using patch_instruction()
for R_PPC_REL24 on should serve as a sufficient fix.
This does have a performance impact, I observed ~15% overhead in
module_load() on POWER8 bare metal with checksum verification off.
Fixes: c35717c71e98 ("powerpc: Set ARCH_HAS_STRICT_MODULE_RWX")
Cc: [email protected] # v5.14+
Reported-by: Joe Lawrence <[email protected]>
Signed-off-by: Russell Currey <[email protected]>
Tested-by: Joe Lawrence <[email protected]>
[mpe: Check return codes from patch_instruction()]
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions