[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EFI executable corruption when live patching is turned off



On 05.08.2020 20:30, Andrew Cooper wrote:
> On 05/08/2020 19:19, Trammell Hudson wrote:
>> When building xen from head with almost any combination of options, the 
>> resulting xen.efi seems properly formed. When CONFIG_LIVEPATCH is turned 
>> off, however, the resulting xen.efi is corrupted in some way and binutils no 
>> longer wants to work with it:
>>
>> ~/build/xen-clean/xen$ git rev-parse HEAD
>> 81fd0d3ca4b2cd309403c6e8da662c325dd35750
>> ~/build/xen-clean/xen$ diff .config.orig .config
>> 71,72c71
>> < CONFIG_LIVEPATCH=y
>> < CONFIG_FAST_SYMBOL_LOOKUP=y
>> ---
>>> # CONFIG_LIVEPATCH is not set
>> 105a105
>>> # CONFIG_COVERAGE is not set
>> ~/build/xen-clean/xen$ objcopy xen-orig.efi test.efi
>> ~/build/xen-clean/xen$ objcopy xen.efi test.efi
>> objcopy: test.efi: Data Directory size (1c) exceeds space left in section 
>> (18)
>> objcopy: test.efi: error copying private BFD data: file in wrong format
>> ~/build/xen-clean/xen$ objcopy --version | head -1
>> GNU objcopy (GNU Binutils for Ubuntu) 2.34
>>
>>
>> I spent most of today unsuccessfully trying to figure out what was different 
>> between the builds (on multiple build host OS with different binutils), so 
>> I'm hoping that perhaps someone else has seen this problem.
> 
> CC'ing appropriate maintainers.
> 
> The difference caused by CONFIG_LIVEPATCH will probably be the logic to
> embed the GNU BuildID, which for xen.efi takes a trip through .bin/.ihex
> immediately prior to the final link.

The build ID gets added independent of LIVEPATCH; aiui it's merely a
prereq for it. In any event this wouldn't be an excuse: We don't
fiddle with the binary after it was created by ld, so I can't help
thinking this is a binutils bug. I'll look into this more closely,
but initial experiments produce errors different from the ones
Trammell has reported (albeit I'm using 2.35, not 2.34, in case this
makes a difference).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.