Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VF5z5-0007Zm-S1 for mharc-grub-devel@gnu.org; Thu, 29 Aug 2013 13:26:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF5yy-0007Z1-4T for grub-devel@gnu.org; Thu, 29 Aug 2013 13:26:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VF5ys-0002My-4r for grub-devel@gnu.org; Thu, 29 Aug 2013 13:26:08 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:60232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VF5yr-0002MI-VO for grub-devel@gnu.org; Thu, 29 Aug 2013 13:26:02 -0400 Received: by mail-wi0-f182.google.com with SMTP id ey11so816328wid.3 for ; Thu, 29 Aug 2013 10:26:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=khL58JKVBbkJWKppOX1jet6UIcI4MbDGhfo+EIAsQvo=; b=myIxoFL6ZhtAiZmhw/RI5Q2R85qWUClR1rzrMjSdEazY73fODhM8K61uQ2BFi0e1EF t222Cp9PPlZAueJPSjxvt1bqvgwVYNmtv13uMhKS/0bwqt8qLE8FLEDAdVsKN900J/p1 mueG1U7dew5VGnHv/P6L9BPLdpTpB9CCyN4a1i6bBkJ9ZQHNRUU9uRRtzLTMh7fcLTOc GJRoM6J85zvJiNpn/8eqxMS053Xv9klr2meJntb4mtkhaN3Eld2k9CAW+lhrdZL/2uQL SDBoewePg/coCa6MWbRQXC5mpoTooVailVP+m/x7R03DU3JF00o5Kb/irWbci8XA6ETF VZnw== X-Gm-Message-State: ALoCoQmX/HnQNRjbuFy0iB3ccafn4lYTG2CiOk0HMqDJ8bzqWRMJcK8j/YUaOMP/qPmmhZkcPG+d X-Received: by 10.194.250.69 with SMTP id za5mr47703wjc.80.1377797160963; Thu, 29 Aug 2013 10:26:00 -0700 (PDT) Received: from rocoto.smurfnet.nu ([2001:4b98:dc0:41:216:3eff:fea7:75f3]) by mx.google.com with ESMTPSA id pn7sm14040861wic.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 29 Aug 2013 10:26:00 -0700 (PDT) Date: Thu, 29 Aug 2013 19:26:03 +0200 From: Leif Lindholm To: grub-devel@gnu.org Subject: calculation overflow in grub_mm_init_region Message-ID: <20130829172603.GP18151@rocoto.smurfnet.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.182 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2013 17:26:14 -0000 When allocating memory for the heap on ARMv7 UEFI, the init code pretty much just allocates a chunk from the top of available RAM. This means that when grub_mm_init_region is called for a region extending to the top of the 32-bit address space, addr + size == 0. However, this is not taken into account by arithmetic in this function, causing Grub to fail on one of my platforms[1] before "Welcome to GRUB". Having some trouble getting my head around the grub_mm_init_region code right now (where is grub_mm_base initialised?), so don't have a patch. / Leif [1] Versatile Express V2P-CA15_A7, also known as TC2, has 2GB of RAM starting at 0x80000000.