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

Re: [PATCH] libelf: Handle PVH kernels lacking ENTRY elfnote



On Wed, Oct 14, 2020 at 11:31:50AM -0400, Jason Andryuk wrote:
> Linux kernels only have an ENTRY elfnote when built with CONFIG_PV.  A
> kernel build CONFIG_PVH=y CONFIG_PV=n lacks the note.  In this case,
> virt_entry will be UNSET_ADDR, overwritten by the ELF header e_entry,
> and fail the check against the virt address range.
> 
> Change the code to only check virt_entry against the virtual address
> range if it was set upon entry to the function.
> 
> Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
> 
> ---
> Maybe the overwriting of virt_entry could be removed, but I don't know
> if there would be unintended consequences where (old?) kernels don't
> have an elfnote, but do have an in-range e_entry?  The failing kernel I
> just looked at has an e_entry of 0x1000000.
> 
> Oh, it looks like Mini-OS doesn't set the entry ELFNOTE and relies on
> e_entry (of 0) to pass these checks.
> 

I have not looked into the patch, but please don't use mini-os as a source
for truth. ;-)

It is more likely than not we should fix mini-os instead of Xen and
Linux.

Wei.



 


Rackspace

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