On 07/11/16 11:55, Roger Pau Monne wrote: > Or else ACPI data is always copied at the start of the page pointed by > guest_addr_out, ignoring the page offset. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com> > --- > Cc: Ian Jackson <ian.jack...@eu.citrix.com> > Cc: Wei Liu <wei.l...@citrix.com> > Cc: Boris Ostrovsky <boris.ostrov...@oracle.com> > Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> > --- > tools/libxc/xc_dom_core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/libxc/xc_dom_core.c b/tools/libxc/xc_dom_core.c > index e177667..cbc1a43 100644 > --- a/tools/libxc/xc_dom_core.c > +++ b/tools/libxc/xc_dom_core.c > @@ -1118,6 +1118,9 @@ static int xc_dom_load_acpi(struct xc_dom_image *dom) > goto err; > } > > + ptr = (uint8_t *)ptr + > + (dom->acpi_modules[i].guest_addr_out & ~XC_PAGE_MASK);
You also need to adjust the num_pages calculation, or you risk memcpy()'ing off the end of the foreign mapping. ~Andrew > + > memcpy(ptr, dom->acpi_modules[i].data, dom->acpi_modules[i].length); > munmap(ptr, XC_PAGE_SIZE * num_pages); > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel