Message ID | 1457012320-7876-1-git-send-email-rcojocaru@bitdefender.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/03/2016 03:38 PM, Razvan Cojocaru wrote: > Fixes https://jira.bitdefender.biz/browse/HEIMDALL-71 > Roughly based on Don Slutz' patch: > http://lists.xen.org/archives/html/xen-devel/2014-03/msg03720.html > > Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com> > > --- > Changes since V1: > - Turns out that the only case that has occured in my tests where > errno is not set is the "if (!(pte & 1))" case. Removed all > other errno checks. Sorry about the first line of text, got pasted accidentaly. It's obviously out of context for the Xen project. If it can't be removed when commiting (if this version of the patch is acked, of course), I'm happy to submit V3 with the fix. Thanks, Razvan
On Thu, Mar 03, 2016 at 03:42:49PM +0200, Razvan Cojocaru wrote: > On 03/03/2016 03:38 PM, Razvan Cojocaru wrote: > > Fixes https://jira.bitdefender.biz/browse/HEIMDALL-71 > > Roughly based on Don Slutz' patch: > > http://lists.xen.org/archives/html/xen-devel/2014-03/msg03720.html > > > > Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com> > > > > --- > > Changes since V1: > > - Turns out that the only case that has occured in my tests where > > errno is not set is the "if (!(pte & 1))" case. Removed all > > other errno checks. > > Sorry about the first line of text, got pasted accidentaly. It's > obviously out of context for the Xen project. If it can't be removed > when commiting (if this version of the patch is acked, of course), I'm > happy to submit V3 with the fix. > Just post v3 with the updated commit message and put my ack on it please. Wei. > > Thanks, > Razvan
diff --git a/tools/libxc/xc_pagetab.c b/tools/libxc/xc_pagetab.c index ec97890..92eebd6 100644 --- a/tools/libxc/xc_pagetab.c +++ b/tools/libxc/xc_pagetab.c @@ -88,8 +88,10 @@ unsigned long xc_translate_foreign_address(xc_interface *xch, uint32_t dom, return 0; memcpy(&pte, map + (paddr & (PAGE_SIZE - 1)), size); munmap(map, PAGE_SIZE); - if (!(pte & 1)) + if (!(pte & 1)) { + errno = EADDRNOTAVAIL; return 0; + } paddr = pte & 0x000ffffffffff000ull; if (level == 2 && (pte & PTE_PSE)) { mask = ((mask ^ ~-mask) >> 1); /* All bits below first set bit */
Fixes https://jira.bitdefender.biz/browse/HEIMDALL-71 Roughly based on Don Slutz' patch: http://lists.xen.org/archives/html/xen-devel/2014-03/msg03720.html Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com> --- Changes since V1: - Turns out that the only case that has occured in my tests where errno is not set is the "if (!(pte & 1))" case. Removed all other errno checks. --- tools/libxc/xc_pagetab.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)