livepatch: avoid relocations referencing ignored section symbols
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 8 Apr 2022 12:59:27 +0000 (14:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 Apr 2022 12:59:27 +0000 (14:59 +0200)
commitb953760d0b564478e232e7e64823d2a1506e92b5
tree88230e000155a414d9d435d163ad452869e0cdd4
parent46d80ba371b20a5201b7168a4fee924ba3f80303
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>
master commit: 9120b5737f517fe9d2a3936c38d3a2211630323b
master date: 2022-04-08 10:27:11 +0200
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