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

Re: [PATCH for-4.19] tools/dombuilder: Correct the length calculation in xc_dom_alloc_segment()



On Thu, Jun 27, 2024 at 02:01:34PM +0100, Andrew Cooper wrote:
> xc_dom_alloc_segment() is passed a size in bytes, calculates a size in pages
> from it, then fills in the new segment information with a bytes value
> re-calculated from the number of pages.
> 
> This causes the module information given to the guest (MB, or PVH) to have
> incorrect sizes; specifically, sizes rounded up to the next page.
> 
> This in turn is problematic for Xen.  When Xen finds a gzipped module, it
> peeks at the end metadata to judge the decompressed size, which is a -4
> backreference from the reported end of the module.
> 
> Fill in seg->vend using the correct number of bytes.
> 
> Fixes: ea7c8a3d0e82 ("libxc: reorganize domain builder guest memory 
> allocator")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> 
> For 4.19: This was discovered when trying to test Daniel's gzip cleanup for
> Hyperlaunch.  It's a subtle bug, hidden inside a second bug which isn't
> appropriate content for 4.20.

Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



 


Rackspace

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