From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KulkG-0007i8-NB for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:24:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KulkE-0007hW-GX for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:24:14 -0400 Received: from [199.232.76.173] (port=42262 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KulkC-0007hA-OT for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:24:13 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56362 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KulkC-0008Ur-R9 for qemu-devel@nongnu.org; Tue, 28 Oct 2008 06:24:12 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KulkC-0000dU-4H for qemu-devel@nongnu.org; Tue, 28 Oct 2008 10:24:12 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KulkB-0000dQ-Sn for qemu-devel@nongnu.org; Tue, 28 Oct 2008 10:24:12 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Tue, 28 Oct 2008 10:24:11 +0000 Subject: [Qemu-devel] [5563] page_check_range: fix wrap around test (Lauro Ramos Venancio). Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5563 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5563 Author: balrog Date: 2008-10-28 10:24:11 +0000 (Tue, 28 Oct 2008) Log Message: ----------- page_check_range: fix wrap around test (Lauro Ramos Venancio). Move up the warp around test because line 'end = TARGET_PAGE_ALIGN(start+len);' can interfere with it. Modified Paths: -------------- trunk/exec.c Modified: trunk/exec.c =================================================================== --- trunk/exec.c 2008-10-28 10:21:03 UTC (rev 5562) +++ trunk/exec.c 2008-10-28 10:24:11 UTC (rev 5563) @@ -2081,12 +2081,13 @@ target_ulong end; target_ulong addr; + if (start + len < start) + /* we've wrapped around */ + return -1; + end = TARGET_PAGE_ALIGN(start+len); /* must do before we loose bits in the next step */ start = start & TARGET_PAGE_MASK; - if( end < start ) - /* we've wrapped around */ - return -1; for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) { p = page_find(addr >> TARGET_PAGE_BITS); if( !p )