From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 08579941AA9 for ; Tue, 12 Dec 2023 15:23:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=twHiR5dP9IRedfwvBiyJ+3dkONHmM93Sez4AqKsDGU4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702394586; v=1; b=WcLQhAu6rsDUId4WaMH1aaahWFyNzc+BYECSrPB+KZ0I2mjiD0qVOka9CAT8GEW8LeEWGSbH 5efRIR+EO+kwJwIsxjXFBSqhs7k4PaDNPQ+Oy74bI0wkCLJhDDCLvwq22M0ItMKLad3ckBs62CK 5ZQGnbtlVE5PEZdRQPSbyVRc= X-Received: by 127.0.0.2 with SMTP id EWCWYY7687511x2ig0o0rSEH; Tue, 12 Dec 2023 07:23:06 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.4263.1702394586043958561 for ; Tue, 12 Dec 2023 07:23:06 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-492-38cwGxDDM9iHNKjqFJFR4A-1; Tue, 12 Dec 2023 10:22:59 -0500 X-MC-Unique: 38cwGxDDM9iHNKjqFJFR4A-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6800E3C0E648; Tue, 12 Dec 2023 15:22:58 +0000 (UTC) X-Received: from [10.39.192.120] (unknown [10.39.192.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBCB81C060AF; Tue, 12 Dec 2023 15:22:56 +0000 (UTC) Message-ID: <95c2dd16-e490-39e1-71fc-f80ec0cd5948@redhat.com> Date: Tue, 12 Dec 2023 16:22:55 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v4] ArmVirt: Allow memory attributes protocol to be disabled To: Ard Biesheuvel , Gerd Hoffmann Cc: Ard Biesheuvel , devel@edk2.groups.io, Oliver Steffen , Alexander Graf , Oliver Smith-Denny , Taylor Beebe , Peter Jones , Leif Lindholm References: <20231212083600.1889189-1-ardb@google.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1qAYGfJSsIullL0Ef7KS9XgJx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=WcLQhAu6; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 12/12/23 11:42, Ard Biesheuvel wrote: > On Tue, 12 Dec 2023 at 11:08, Gerd Hoffmann wrote: >> >> On Tue, Dec 12, 2023 at 09:36:00AM +0100, Ard Biesheuvel wrote: >>> From: Ard Biesheuvel >>> >>> Shim's PE loader uses the EFI memory attributes protocol in a way that >>> results in an immediate crash when invoking the loaded image, unless th= e >>> base and size of its executable segment are both aligned to 4k. >>> >>> If this is not the case, it will strip the memory allocation of its >>> executable permissions, but fail to add them back for the executable >>> region, resulting in non-executable code. Unfortunately, the PE loader >>> does not even bother invoking the protocol in this case (as it notices >>> the misalignment), making it very hard for system firmware to work >>> around this by attempting to infer the intent of the caller. >>> >>> So let's introduce a QEMU command line option to indicate that the >>> protocol should not be exposed at all, and a PCD to set the default for >>> this option when it is omitted. >>> >>> -fw_cfg opt/org.tianocore/UninstallMemAttrProtocol,string=3Dy >> >> Tested-by: Gerd Hoffmann >> Reviewed-by: Gerd Hoffmann >> >=20 > Thanks all - I've queued this up now. >=20 If it hasn't been merged yet, add: Reviewed-by: Laszlo Ersek thanks Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112447): https://edk2.groups.io/g/devel/message/112447 Mute This Topic: https://groups.io/mt/103126734/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-