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 441E28215F for ; Thu, 23 Feb 2017 01:36:04 -0800 (PST) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 CCB177E9D3; Thu, 23 Feb 2017 09:36:04 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-58.phx2.redhat.com [10.3.116.58]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1N9a338000495; Thu, 23 Feb 2017 04:36:03 -0500 To: Ard Biesheuvel , edk2-devel@ml01.01.org References: <1487764485-18631-1-git-send-email-ard.biesheuvel@linaro.org> Cc: leif.lindholm@linaro.org From: Laszlo Ersek Message-ID: <8f8f4c91-0114-0b38-f1f8-d653253b9fb0@redhat.com> Date: Thu, 23 Feb 2017 10:36:01 +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: <1487764485-18631-1-git-send-email-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 23 Feb 2017 09:36:04 +0000 (UTC) Subject: Re: [PATCH] ArmVirtPkg/ArmVirt.dsc.inc: AARCH64: enable DXE image protection feature 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: Thu, 23 Feb 2017 09:36:04 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 02/22/17 12:54, Ard Biesheuvel wrote: > Enable the new DXE image protection for all image, i.e., FV images but > also external images that originate from disk or the network, such as > OS loaders. > > This complements work that is underway on the arm64/Linux kernel side, > to emit the OS loader with 4 KB section alignment, and a suitable split > between code and data. > > http://marc.info/?l=linux-arm-kernel&m=148655557227819 > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > ArmVirtPkg/ArmVirt.dsc.inc | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc > index dbd6678accde..c0d5e7c6aa6d 100644 > --- a/ArmVirtPkg/ArmVirt.dsc.inc > +++ b/ArmVirtPkg/ArmVirt.dsc.inc > @@ -17,6 +17,9 @@ [Defines] > DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F > DEFINE TTY_TERMINAL = FALSE > > +[BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION] > + GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x1000 > + > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] > GCC:*_*_ARM_DLINK_FLAGS = -z common-page-size=0x1000 > GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000 > @@ -380,6 +383,13 @@ [PcdsFixedAtBuild.common] > [PcdsFixedAtBuild.ARM] > gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|40 > > +[PcdsFixedAtBuild.AARCH64] > + # > + # Enable strict image permissions for all images. (This applies > + # only to images that were built with >= 4 KB section alignment.) > + # > + gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x3 > + > [Components.common] > # > # Networking stack > So, if I understand correctly, setting BIT0 will not break external images with unaligned sections, they just won't be protected, and they'll trigger loud warnings. OK. Reviewed-by: Laszlo Ersek Thanks Laszlo