From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 99B02821B6 for ; Wed, 1 Mar 2017 10:32:26 -0800 (PST) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3057E7E9FF; Wed, 1 Mar 2017 18:32:27 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-249.phx2.redhat.com [10.3.116.249]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v21IWP2x030006; Wed, 1 Mar 2017 13:32:26 -0500 To: Ard Biesheuvel , edk2-devel@ml01.01.org References: <1488378977-15398-1-git-send-email-ard.biesheuvel@linaro.org> Cc: leif.lindholm@linaro.org From: Laszlo Ersek Message-ID: <6d185b29-8917-72ce-9484-84cb03435701@redhat.com> Date: Wed, 1 Mar 2017 19:32:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1488378977-15398-1-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 01 Mar 2017 18:32:27 +0000 (UTC) Subject: Re: [PATCH v2] ArmVirtPkg AARCH64: enable NX memory protection for all platforms X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 18:32:26 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/01/17 15:36, Ard Biesheuvel wrote: > This sets the recently introduced PCD PcdDxeNxMemoryProtectionPolicy to > a value that protects all memory regions except code regions against > inadvertent execution. > > Note that this does not [yet] protect EfiLoaderData regions, due to > compatibility issues with shim and GRUB. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > Reviewed-by: Jiewen Yao > --- > v2: leave EfiLoaderData executable for the time being > > ArmVirtPkg/ArmVirt.dsc.inc | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc > index 2b0a44e14d24..a91b27f13cf2 100644 > --- a/ArmVirtPkg/ArmVirt.dsc.inc > +++ b/ArmVirtPkg/ArmVirt.dsc.inc > @@ -383,6 +383,13 @@ [PcdsFixedAtBuild.AARCH64] > # > gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x3 > > + # > + # Enable NX memory protection for all non-code regions, including OEM and OS > + # reserved ones, with the exception of LoaderData regions, of which OS loaders > + # (i.e., GRUB) may assume that its contents are executable. > + # > + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy|0xC000000000007FD1 > + > [Components.common] > # > # Networking stack > Reviewed-by: Laszlo Ersek Tested-by: Laszlo Ersek