From nobody Mon Sep 16 19:05:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+101130+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101130+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1678727924; cv=none; d=zohomail.com; s=zohoarc; b=lObtxTmDWP5e+bFkJov6C3SMW1P1tYhHwZ0LxhHvBXK1XOYEAxJTmZEefsJ43WoQ3fJjQKN5+jNpGiLoPf1BqVBVpuiZpwronoDdwvIs7R/4Rdyg/pySJlHIVAD1BM8Ci6MdueXK5xaxaRBEd06l6DoAAXzwYinX3CDqskvlQ/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678727924; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gC8OvTA6emvweCkBTGrJ3fnsgUAyOmn++c+QGGIycK0=; b=g6WnvTNblca/Tt70OxClcVpablfbH4fRymgHXZKKqerSa8oRiVIim27IkNplC1TMtNFYHyfPETsRjDxI84Kj/Ri+eM0hWbC6izjG/OCXYTOYUYXvJOhrj3RIqMtFcdLVUC4hKl/i19kAuY1lQWyxBfbuPIjZYe3JB3c1xLyFJtw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+101130+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678727924281261.9038144747668; Mon, 13 Mar 2023 10:18:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4cg0YY1788612xuFiRNrlkqC; Mon, 13 Mar 2023 10:18:43 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.26504.1678727923351028535 for ; Mon, 13 Mar 2023 10:18:43 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DBD6361365; Mon, 13 Mar 2023 17:18:42 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EFEBC433A0; Mon, 13 Mar 2023 17:18:39 +0000 (UTC) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar , Taylor Beebe Subject: [edk2-devel] [PATCH v5 26/38] ArmVirtPkg/ArmVirtQemu: Use read-only memory region type for code flash Date: Mon, 13 Mar 2023 18:17:02 +0100 Message-Id: <20230313171714.3866151-27-ardb@kernel.org> In-Reply-To: <20230313171714.3866151-1-ardb@kernel.org> References: <20230313171714.3866151-1-ardb@kernel.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ardb@kernel.org X-Gm-Message-State: 5RxZzO2X0v5M824bbItPmmmfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678727923; bh=6+aV8sLfMaNmny+lu2XP7aD8rGucuqYoSa+1M5SX/Nc=; h=Cc:Date:From:Reply-To:Subject:To; b=FLrgw4BEx5ubUY59Rrh6PmSPIxVzgp8xp+fNqHaAr6QcIFngMbKpAKrhOELzfO5yas1 AZ2VzLfkbGRKLs/HBJ1naLXtjkK/AjUB7CvOKWVn2SxiCQVW8TsqZ7CwJVnnYIr7Vg12T T78DpP7iSA5W46KG6CXtlstBsSCpcnNuMLE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678727926336100002 Content-Type: text/plain; charset="utf-8" Map the code flash with read-only attributes so we can execute from it even under a memory protection regime that enables WXN, making all writable memory regions non-executable by default. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c b/A= rmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c index aa083cec2082..a5324b1e4eed 100644 --- a/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c +++ b/ArmVirtPkg/Library/QemuVirtMemInfoLib/QemuVirtMemInfoLib.c @@ -115,7 +115,7 @@ ArmVirtGetMemoryMap ( VirtualMemoryTable[2].PhysicalBase =3D PcdGet64 (PcdFvBaseAddress); VirtualMemoryTable[2].VirtualBase =3D VirtualMemoryTable[2].PhysicalBas= e; VirtualMemoryTable[2].Length =3D FixedPcdGet32 (PcdFvSize); - VirtualMemoryTable[2].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK; + VirtualMemoryTable[2].Attributes =3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE= _BACK_RO; =20 // End of Table ZeroMem (&VirtualMemoryTable[3], sizeof (ARM_MEMORY_REGION_DESCRIPTOR)); --=20 2.39.2 -=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 (#101130): https://edk2.groups.io/g/devel/message/101130 Mute This Topic: https://groups.io/mt/97586033/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-