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

Re: [Xen-devel] [PATCH v4] x86/setup: disallow any src/dst overlaps when relocating Xen image



>>> On 03.04.18 at 17:54, <daniel.kiper@xxxxxxxxxx> wrote:
> Commit 0d31d16 (x86/setup: do not relocate Xen over current Xen image
> placement) disallowed src/dst images overlaps when relocating Xen image.
> Though it deliberately allowed destination region between __image_base__
> and (__image_base__ + XEN_IMG_OFFSET) overlaps with the end of source
> image. And here is the problem. If anything between __page_tables_start
> and __page_tables_end in source image lands in the overlap then some or
> even all page table entries may not be updated. This usually means boom
> in early boot which will be difficult to the investigate. So, I think
> that we have three choices to fix the issue:
>   - drop XEN_IMG_OFFSET from
>     if ( (end > s) && (end - reloc_size + XEN_IMG_OFFSET >= __pa(_end)) )
>   - add XEN_IMG_OFFSET to xen_phys_start in PFN_DOWN(xen_phys_start)
>     used in loops as one of conditions,
>   - change PFN_DOWN(xen_phys_start) to PFN_DOWN(xen_remap_end_pfn)
>     proposed in earlier version of this patch.
> 
> This patch implements the first option. This way we will avoid all kinds
> of overlaps which are always full can of worms.

Personally I'd like option 2 better, as there's nothing of interest in the
[0,XEN_IMG_OFFSET) range. Instead of modifying every
PFN_DOWN(xen_phys_start), perhaps simply introduce a local variable,
accompanied by a suitable comment.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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