Skip to contentSkip to conversation

pae u32 overflow in xc_linux_build.c (bug 242)

PATCH New Scott Parish 1 participant 1 message Oct 11, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pae u32 overflow in xc_linux_build.c (bug 242)

While this doesn't entirely solve bug 242, the attached patch gets us further.

sRp

Signature · 2 lines
Scott Parish
Signed-off-by: [email protected]
tools/libxc/xc_linux_build.c +2 -2
diff -rN -pu old-xen-build2/tools/libxc/xc_linux_build.c new-xen-build2/tools/libxc/xc_linux_build.c
@@ -500,11 +500,11 @@ static int setup_guest(int xc_handle,
            _p(dsi.v_start), _p(v_end));
     printf(" ENTRY ADDRESS: %p\n", _p(dsi.v_kernentry));
 
-    if ( (v_end - dsi.v_start) > (nr_pages * PAGE_SIZE) )
+    if ( ((v_end - dsi.v_start)>>PAGE_SHIFT) > nr_pages )
     {
         printf("Initial guest OS requires too much space\n"
                "(%luMB is greater than %luMB limit)\n",
-               (v_end-dsi.v_start)>>20, (nr_pages<<PAGE_SHIFT)>>20);
+               (v_end-dsi.v_start)>>20, nr_pages>>(20-PAGE_SHIFT));
         goto error_out;
     }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel