Fix ptr calculation when converting from a VA

The ptr calculation shall take the offset into the page into account
when ptr is valid.

Reported regression on NetBSD's port-xen with last known working libxen
being rev 2.9. This corrupts the kernel symbol table when the table is
not loaded on a page boundary.

Issue was tracked down by FastIce and Jeff Rizzo. See also
http://mail-index.netbsd.org/port-xen/2013/10/16/msg008088.html

Signed-off-by: Jean-Yves Migeon <jym@NetBSD.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
master commit: cb08944a48
master date: 2013-11-29 11:07:01 +0000
This commit is contained in:
Jean-Yves Migeon authored and Jan Beulich committed 2013-12-09 14:30:29 +01:00
1 parent 3014b79dcd
commit b3a75d8a74
1 file changed
+1 -1
+1 -1
View File
@@ -335,7 +335,7 @@ static inline void *xc_dom_vaddr_to_ptr(struct xc_dom_image *dom,
if ( ptr == NULL )
return ptr;
*safe_region_out = (safe_region_count << XC_DOM_PAGE_SHIFT(dom)) - offset;
return ptr;
return ptr + offset;
}
static inline xen_pfn_t xc_dom_p2m_host(struct xc_dom_image *dom, xen_pfn_t pfn)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.