From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Scott Parish" Subject: [patch] pae u32 overflow in xc_linux_build.c (bug 242) Date: Tue, 11 Oct 2005 23:07:35 +0000 Message-ID: <20051011230734.GI3417@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qtZFehHsKgwS5rPz" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --qtZFehHsKgwS5rPz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline While this doesn't entirely solve bug 242, the attached patch gets us further. sRp -- Scott Parish Signed-off-by: srparish@us.ibm.com --qtZFehHsKgwS5rPz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xc_linux_build-overflow.diff" diff -rN -pu old-xen-build2/tools/libxc/xc_linux_build.c new-xen-build2/tools/libxc/xc_linux_build.c --- old-xen-build2/tools/libxc/xc_linux_build.c 2005-10-04 19:08:38.000000000 +0000 +++ new-xen-build2/tools/libxc/xc_linux_build.c 2005-10-11 22:24:34.000000000 +0000 @@ -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<>20); + (v_end-dsi.v_start)>>20, nr_pages>>(20-PAGE_SHIFT)); goto error_out; } --qtZFehHsKgwS5rPz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --qtZFehHsKgwS5rPz--