From patchwork Mon Aug 25 19:19:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 35928 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4BB6720565 for ; Mon, 25 Aug 2014 19:20:05 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id v10sf106992742pde.6 for ; Mon, 25 Aug 2014 12:20:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=sXqb4yuj8M7iwE3UHELBepJTZ+TJ9W1rCtD/CuJEWIk=; b=UNOATWrgAdM7MzVcmsrXUdf922Sp2IxaEIBe6/i9WOBkTxwifW26UEZ2HtgDX7zqdd zfEU0tFYx4NCv5xpIMm82EMzFCQDUv/rU9TIyD2Laa3RvMOPuFp3lfzLOTkVHNJDrkul hMB8FguQPncxd0ebiT7aEmzBRklLK2vLA5Hr4lCp5y2AXc41GDSBd3hha2LVblYv2+pf 1nrVsBGir4tldYR5EyGrV73nhsX3zL6AsMuamroHCjGNiAHX8LP64aJd3jpl2e0E1JjB Wa9tvR+vxAWFidOUA75PhyYVwOGpZELISzI2BuE1efkIaPYwQ5003ocA7mD1WgixTc32 CBpQ== X-Gm-Message-State: ALoCoQlH12e3zEoXPoS9yMG0LDKpDs6m0rFkb3ac1kXVjbIOIjJln5pBplSziRfozUYs6Bm97vG5 X-Received: by 10.66.252.6 with SMTP id zo6mr15170191pac.40.1408994404521; Mon, 25 Aug 2014 12:20:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.232 with SMTP id 95ls2311361qgb.94.gmail; Mon, 25 Aug 2014 12:20:04 -0700 (PDT) X-Received: by 10.52.89.134 with SMTP id bo6mr240619vdb.79.1408994404387; Mon, 25 Aug 2014 12:20:04 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id pr2si491763vdb.23.2014.08.25.12.20.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 12:20:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so15432411vcb.7 for ; Mon, 25 Aug 2014 12:20:04 -0700 (PDT) X-Received: by 10.221.5.137 with SMTP id og9mr20106240vcb.18.1408994404287; Mon, 25 Aug 2014 12:20:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp141493vcb; Mon, 25 Aug 2014 12:20:03 -0700 (PDT) X-Received: by 10.42.211.79 with SMTP id gn15mr3601536icb.63.1408994403665; Mon, 25 Aug 2014 12:20:03 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id xd10si657537icb.103.2014.08.25.12.20.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Aug 2014 12:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XLzo3-0002Fq-VA; Mon, 25 Aug 2014 19:19:56 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XLzo2-0002Fk-W7 for edk2-devel@lists.sourceforge.net; Mon, 25 Aug 2014 19:19:55 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.212.169 as permitted sender) client-ip=209.85.212.169; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wi0-f169.google.com; Received: from mail-wi0-f169.google.com ([209.85.212.169]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1XLzo2-0000Jc-98 for edk2-devel@lists.sourceforge.net; Mon, 25 Aug 2014 19:19:54 +0000 Received: by mail-wi0-f169.google.com with SMTP id n3so4155904wiv.0 for ; Mon, 25 Aug 2014 12:19:48 -0700 (PDT) X-Received: by 10.180.35.134 with SMTP id h6mr17609104wij.0.1408994388049; Mon, 25 Aug 2014 12:19:48 -0700 (PDT) Received: from ards-macbook-pro.local ([193.77.13.198]) by mx.google.com with ESMTPSA id b3sm3476891wiw.22.2014.08.25.12.19.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 12:19:47 -0700 (PDT) From: Ard Biesheuvel To: lersek@redhat.com, olivier.martin@arm.com, edk2-devel@lists.sourceforge.net, peter.maydell@linaro.org, christoffer.dall@linaro.org, drjones@redhat.com, ilias.biris@linaro.org, leif.lindholm@linaro.org Date: Mon, 25 Aug 2014 21:19:19 +0200 Message-Id: <1408994367-11143-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1408994367-11143-1-git-send-email-ard.biesheuvel@linaro.org> References: <1408994367-11143-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1XLzo2-0000Jc-98 Subject: [edk2] [PATCH 02/10] PeiCore: allow FVs residing at physical address 0x0 X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 In the ARM world, it is quite common to have NOR flash at 0x0 and DRAM elsewhere. Don't treat pointers to FVs residing there as invalid NULL pointers but as a valid 0x0 physical address. Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/Pei/FwVol/FwVol.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index fe876ed393a9..8186a80276d3 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -1422,10 +1422,6 @@ PeiFfsFvPpiProcessVolume ( ASSERT (FvHandle != NULL); - if (Buffer == NULL) { - return EFI_VOLUME_CORRUPTED; - } - // // The build-in EFI_PEI_FIRMWARE_VOLUME_PPI for FFS2/FFS3 support memory-mapped // FV image and the handle is pointed to Fv image's buffer. @@ -1712,7 +1708,7 @@ PeiFfsFvPpiGetVolumeInfo ( EFI_FIRMWARE_VOLUME_HEADER FwVolHeader; EFI_FIRMWARE_VOLUME_EXT_HEADER *FwVolExHeaderInfo; - if ((VolumeInfo == NULL) || (FvHandle == NULL)) { + if (VolumeInfo == NULL) { return EFI_INVALID_PARAMETER; }