livepatch: avoid relocations referencing ignored section symbols
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 8 Apr 2022 08:27:11 +0000 (10:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 Apr 2022 08:27:11 +0000 (10:27 +0200)
commit9120b5737f517fe9d2a3936c38d3a2211630323b
tree599e05c376fbd3b712b742e2dedd4648fc96ab1b
parent0dc1f929e8fed681dec09ca3ea8de38202d5bf30
livepatch: avoid relocations referencing ignored section symbols

Track whether symbols belong to ignored sections in order to avoid
applying relocations referencing those symbols. The address of such
symbols won't be resolved and thus the relocation will likely fail or
write garbage to the destination.

Return an error in that case, as leaving unresolved relocations would
lead to malfunctioning payload code.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
xen/arch/arm/arm32/livepatch.c
xen/arch/arm/arm64/livepatch.c
xen/arch/x86/livepatch.c
xen/common/livepatch_elf.c
xen/include/xen/livepatch_elf.h