From nobody Sun Feb 8 14:35:29 2026 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+108176+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+108176+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1693437561; cv=none; d=zohomail.com; s=zohoarc; b=mWEU+/iCKC4zTVXb5YvxwZyVRbpOefJIywml52WTUxbErLo8JT1ecfX3KumLi51DLKuheb5MHmhKQAXqjN3f3YlYObvMSVtfcFPOvcb5J0Q8D17iqsA0DXPdxMKB+zcyBaAQsJGpbOs0n89Sta550gP0IXBDqbXuRzlPPzHBeUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693437561; 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=I2xOxm5TjtU2mLbOikNcmM8MZxNfkqn9GoMwhy2FaLs=; b=cktOquSreHzqKJPZuWg9vMDu2hWy1r7G//N69pYD78wxGP+iYUuN5rU4UuPIQjq8EyqVPgAcbP12koQZlw/C2QPRu21919elvrqE/QjmtbFJKj9yM8hNVoKc3t1wxlYmlz4GRFyOew0OjAXQp4yQbHPTNcxM33Q1QtaIYVKdZ6c= 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+108176+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 16934375609451016.5348669193695; Wed, 30 Aug 2023 16:19:20 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=vIErlT7iRRM6tZzdAR/Gu51oQlfF5tQfH8zrht01ol0=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1693437560; v=1; b=EknDt7kEuKPg3EMfT9cE5oC5KafrBweNlHNIgpHn0m3M7At3dBpo0J5QPXsJPqfrmfYKECTB 57yDTDivTntVTh4b6oO7EB5R7Y9aabmVGuPEtp7O+FxcXvOJPpdzQ9o7rUCtk5oW8rCzRQQYyOQ C73qY+mCSwMGQWjs6ewf+lM8= X-Received: by 127.0.0.2 with SMTP id ZwLYYY1788612xO6QiMY7dNp; Wed, 30 Aug 2023 16:19:20 -0700 X-Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.web11.4964.1693437560064622897 for ; Wed, 30 Aug 2023 16:19:20 -0700 X-Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-68becf931bfso164995b3a.0 for ; Wed, 30 Aug 2023 16:19:20 -0700 (PDT) X-Gm-Message-State: Q5tRI7cLxeOwhsECRtplZbl9x1787277AA= X-Google-Smtp-Source: AGHT+IHG1op0DsSogS5vhjMYGHelWVK9d9oYwn7RwYX0mfN9jHqvIQ5q7LIuXjE0/DJatz0SkCdJDA== X-Received: by 2002:a05:6a21:790a:b0:13d:af0e:4ee5 with SMTP id bg10-20020a056a21790a00b0013daf0e4ee5mr4246433pzc.18.1693437559345; Wed, 30 Aug 2023 16:19:19 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id x16-20020a62fb10000000b0064398fe3451sm102550pfm.217.2023.08.30.16.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 16:19:18 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann Subject: [edk2-devel] [PATCH v3 22/26] ArmVirtPkg: Apply Memory Protections via SetMemoryProtectionsLib Date: Wed, 30 Aug 2023 16:18:30 -0700 Message-ID: <20230830231851.779-23-taylor.d.beebe@gmail.com> In-Reply-To: <20230830231851.779-1-taylor.d.beebe@gmail.com> References: <20230830231851.779-1-taylor.d.beebe@gmail.com> MIME-Version: 1.0 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,taylor.d.beebe@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1693437562071100089 Content-Type: text/plain; charset="utf-8" Set the memory protections on Arm virtual platforms. Because the QemuFg parser is not currently available in ArmVirtPkg, use the RELEASE profile by default. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann --- ArmVirtPkg/MemoryInitPei/MemoryInitPeim.c | 11 +++++++++-- ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.c b/ArmVirtPkg/MemoryI= nitPei/MemoryInitPeim.c index ef88a9df1d62..90718d05abe8 100644 --- a/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.c +++ b/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -76,8 +77,9 @@ InitializeMemory ( IN CONST EFI_PEI_SERVICES **PeiServices ) { - UINTN UefiMemoryBase; - EFI_STATUS Status; + UINTN UefiMemoryBase; + EFI_STATUS Status; + DXE_MEMORY_PROTECTION_SETTINGS DxeSettings; =20 ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ALLOC_ADDRESS); =20 @@ -100,5 +102,10 @@ InitializeMemory ( ); ASSERT_EFI_ERROR (Status); =20 + DxeSettings =3D DxeMemoryProtection= Profiles[DxeMemoryProtectionSettingsRelease].Settings; + DxeSettings.NullPointerDetection.DisableEndOfDxe =3D TRUE; + + SetDxeMemoryProtectionSettings (&DxeSettings, DxeMemoryProtectionSetting= sRelease); + return Status; } diff --git a/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf b/ArmVirtPkg/Memor= yInitPei/MemoryInitPeim.inf index 2039f71a0ebe..d13325a89e14 100644 --- a/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf +++ b/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf @@ -34,6 +34,7 @@ [LibraryClasses] ArmLib ArmPlatformLib MemoryInitPeiLib + SetMemoryProtectionsLib =20 [Guids] gEfiMemoryTypeInformationGuid --=20 2.42.0.windows.1 -=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 (#108176): https://edk2.groups.io/g/devel/message/108176 Mute This Topic: https://groups.io/mt/101064097/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-