------- Comment on attachment From <email address hidden> 2018-01-09 01:39 EDT-------
Livepatch re-uses module loader function apply_relocate_add() to write
relocations, instead of managing them by arch-dependent
klp_write_module_reloc() function.
apply_relocate_add() doesn't understand livepatch symbols (marked with
SHN_LIVEPATCH symbol section index) and assumes them to be local
symbols by default for R_PPC64_REL24 relocation type. It fails with an
error, when trying to calculate offset with local_entry_offset():
module_64: kpatch_meminfo: REL24 -1152921504897399800 out of range!
Whereas livepatch symbols are essentially SHN_UNDEF, should be called
via stub used for global calls. This issue can be fixed by teaching
apply_relocate_add() to handle both SHN_UNDEF/SHN_LIVEPATCH symbols
via the same stub. This patch extends SHN_UNDEF code to handle
livepatch symbols too.
------- Comment on attachment From <email address hidden> 2018-01-09 01:39 EDT-------
Livepatch re-uses module loader function apply_relocate_ add() to write module_ reloc() function.
relocations, instead of managing them by arch-dependent
klp_write_
apply_relocate_ add() doesn't understand livepatch symbols (marked with offset( ):
SHN_LIVEPATCH symbol section index) and assumes them to be local
symbols by default for R_PPC64_REL24 relocation type. It fails with an
error, when trying to calculate offset with local_entry_
module_64: kpatch_meminfo: REL24 -11529215048973 99800 out of range!
Whereas livepatch symbols are essentially SHN_UNDEF, should be called add() to handle both SHN_UNDEF/ SHN_LIVEPATCH symbols
via stub used for global calls. This issue can be fixed by teaching
apply_relocate_
via the same stub. This patch extends SHN_UNDEF code to handle
livepatch symbols too.