From patchwork Wed Sep 14 12:48:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 114675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6E51FB70BE for ; Wed, 14 Sep 2011 22:48:58 +1000 (EST) Received: from localhost ([::1]:58883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3otW-0005Jy-KW for incoming@patchwork.ozlabs.org; Wed, 14 Sep 2011 08:48:50 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3otM-0005Jf-P2 for qemu-devel@nongnu.org; Wed, 14 Sep 2011 08:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3otI-00074J-Jv for qemu-devel@nongnu.org; Wed, 14 Sep 2011 08:48:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3otI-000746-Bc for qemu-devel@nongnu.org; Wed, 14 Sep 2011 08:48:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8ECmYSD021750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Sep 2011 08:48:34 -0400 Received: from balrog.usersys.redhat.com (dhcp-1-24.tlv.redhat.com [10.35.1.24]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8ECmW70026106; Wed, 14 Sep 2011 08:48:33 -0400 Message-ID: <4E70A29F.1010105@redhat.com> Date: Wed, 14 Sep 2011 15:48:31 +0300 From: Avi Kivity User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 MIME-Version: 1.0 To: Anthony Liguori , qemu-devel X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL] Memory core integer overflow fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Please pull from git://github.com/avikivity/qemu.git memory/core to receive a core fix for an integer overflow problem hitting ppc: David Gibson (1): Fix subtle integer overflow bug in memory API memory.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) static AddrRange addrrange_intersection(AddrRange r1, AddrRange r2) diff --git a/memory.c b/memory.c index 57f0fa4..101b67c 100644 --- a/memory.c +++ b/memory.c @@ -55,8 +55,8 @@ static AddrRange addrrange_shift(AddrRange range, int64_t delta) static bool addrrange_intersects(AddrRange r1, AddrRange r2) { - return (r1.start >= r2.start && r1.start < r2.start + r2.size) - || (r2.start >= r1.start && r2.start < r1.start + r1.size); + return (r1.start >= r2.start && (r1.start - r2.start) < r2.size) + || (r2.start >= r1.start && (r2.start - r1.start) < r1.size); }