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 A8E0A7803CE for ; Wed, 30 Aug 2023 23:19:26 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sCpnj+nz6otkdMMQFjfDmU4ebghcR4lfVtE1ZHNOBhA=; 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=1693437565; v=1; b=dZ4EN6rSB242CvF9PsGyBeKPfBANPmxTkGqOexCtO9MoylClqs2F6vpr/UWHtgianzFwsbNV B4tTlnMNcBHMFxYGcVehFq6S3+6ShznXhO2Zdle1o8xzfthPuk1/AYwBTu9yBWdALnfGbPj7dZk aHPg+bakJz9ZRWTbHUJTRHrs= X-Received: by 127.0.0.2 with SMTP id zdwZYY7687511xCFnjkLR8BC; Wed, 30 Aug 2023 16:19:25 -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: YyEydsEa2TNiGUYYGqqn4NB7x7686176AA= 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: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=dZ4EN6rS; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.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 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/MemoryInitPei/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; ASSERT (FixedPcdGet64 (PcdSystemMemoryBase) < (UINT64)MAX_ALLOC_ADDRESS); @@ -100,5 +102,10 @@ InitializeMemory ( ); ASSERT_EFI_ERROR (Status); + DxeSettings = DxeMemoryProtectionProfiles[DxeMemoryProtectionSettingsRelease].Settings; + DxeSettings.NullPointerDetection.DisableEndOfDxe = TRUE; + + SetDxeMemoryProtectionSettings (&DxeSettings, DxeMemoryProtectionSettingsRelease); + return Status; } diff --git a/ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf b/ArmVirtPkg/MemoryInitPei/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 [Guids] gEfiMemoryTypeInformationGuid -- 2.42.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-