From patchwork Sat May 9 20:15:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48186 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 37C7521550 for ; Sat, 9 May 2015 20:16:30 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf32215541lab.1 for ; Sat, 09 May 2015 13:16:29 -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:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=Rl/IPcTdOs/jFlD5ofKP71wMdQ8fGX4dy5cvQvwtN38=; b=RqeZBDci3GwBzbD1BoA/igMg/063FXsXN0cuo76Sq4dR6f5shwxBXwhcJP0sB+qqaQ LNjgXAkMZjlkufJZXp4qOa+CLrUpxHwFZQpfFocaif63NY7QYlJtsbRRfWE39X0P/k29 j2wjOlzHhMYtvIzQy2Js9xDTiGIk6AYbUsMJSqQuCMLCkNw7lvovhG2MEbSS0KL3MKYJ DoRPuMzXhqGtZcKBOVPvMLDBZMda4t7JhV0OFTI9aF3FvCdOl4g2w/rDUBIns71k6kk1 8xvurlouF9oRnUkJ5mpZ9b/vwSK8Q/4Rv8pGts6fLvDcvohsaYcFwPwUX/ApUuSyAV09 B+Jg== X-Gm-Message-State: ALoCoQn/8aTEVdrb/nEILwa9wxbc6o70O9Q74EchhrqM1LXOc+7kcSxdb6HSj/rz0DNJKVSKXI3J X-Received: by 10.194.236.230 with SMTP id ux6mr2748703wjc.5.1431202589194; Sat, 09 May 2015 13:16:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.42 with SMTP id cj10ls502245lad.51.gmail; Sat, 09 May 2015 13:16:29 -0700 (PDT) X-Received: by 10.112.72.104 with SMTP id c8mr2876991lbv.77.1431202589031; Sat, 09 May 2015 13:16:29 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id uo6si5571541lbc.21.2015.05.09.13.16.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 May 2015 13:16:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lagv1 with SMTP id v1so71841325lag.3 for ; Sat, 09 May 2015 13:16:28 -0700 (PDT) X-Received: by 10.112.182.4 with SMTP id ea4mr2873636lbc.35.1431202588858; Sat, 09 May 2015 13:16:28 -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.112.108.230 with SMTP id hn6csp712468lbb; Sat, 9 May 2015 13:16:28 -0700 (PDT) X-Received: by 10.107.130.145 with SMTP id m17mr4597854ioi.89.1431202587424; Sat, 09 May 2015 13:16:27 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id y15si6724192ich.81.2015.05.09.13.16.26 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 May 2015 13:16:27 -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-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YrBAV-00062K-NN; Sat, 09 May 2015 20:16:15 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YrBAU-00062E-Cp for edk2-devel@lists.sourceforge.net; Sat, 09 May 2015 20:16:14 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wi0-f174.google.com; Received: from mail-wi0-f174.google.com ([209.85.212.174]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YrBAT-0004mf-FV for edk2-devel@lists.sourceforge.net; Sat, 09 May 2015 20:16:14 +0000 Received: by widdi4 with SMTP id di4so59408065wid.0 for ; Sat, 09 May 2015 13:16:07 -0700 (PDT) X-Received: by 10.194.63.226 with SMTP id j2mr7293102wjs.69.1431202567467; Sat, 09 May 2015 13:16:07 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id vy5sm11830272wjc.33.2015.05.09.13.16.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 09 May 2015 13:16:06 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, star.zeng@intel.com, feng.tian@intel.com Date: Sat, 9 May 2015 22:15:42 +0200 Message-Id: <1431202542-31670-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 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 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YrBAT-0004mf-FV Subject: [edk2] [PATCH] MdeModulePkg: enforce 8 byte alignment for pool allocations 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.215.43 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 According to the UEFIv2.5 spec section 6.2, the allocations returned by the AllocatePool () boot service must be 8 byte aligned. So make our implementation conform to the spec, by rearranging the pool head struct so that its size is always a multiple of 8 bytes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/Dxe/Mem/Pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Mem/Pool.c b/MdeModulePkg/Core/Dxe/Mem/Pool.c index ac717fb65f7a..6f8f5cfb295d 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Pool.c +++ b/MdeModulePkg/Core/Dxe/Mem/Pool.c @@ -26,9 +26,9 @@ typedef struct { #define POOL_HEAD_SIGNATURE SIGNATURE_32('p','h','d','0') typedef struct { UINT32 Signature; - UINT32 Reserved; EFI_MEMORY_TYPE Type; UINTN Size; + UINTN Reserved; CHAR8 Data[1]; } POOL_HEAD;