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 D2ADD7803CF for ; Fri, 18 Aug 2023 22:58:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=AsV9R9f4cmRGespj1Di1HFirIzbJGXZqmcazNiBFYHw=; 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=1692399489; v=1; b=LRcD/tn7vJMlzY1kSJlzCAeY26ndFKKE8Ly5KlZdX7Zzanf7aEL0iEVMt8MZ6EMRpwAEqVjT /9MCFDun1oIZKriC+ETwnk0T/TVqMA7ZpilikIKZh2z9iH1LhHi76d3uMfSBPmesGWMjnEYP2UD 04lGHuOrH3I7ElT3VxXe/cSc= X-Received: by 127.0.0.2 with SMTP id YAC7YY7687511xXg2uWxlHLj; Fri, 18 Aug 2023 15:58:09 -0700 X-Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mx.groups.io with SMTP id smtpd.web10.3191.1692397958539463471 for ; Fri, 18 Aug 2023 15:32:38 -0700 X-Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-689fb672dc8so1046895b3a.0 for ; Fri, 18 Aug 2023 15:32:38 -0700 (PDT) X-Gm-Message-State: eKrgT87lqA5pwwo4EdwQTWjpx7686176AA= X-Google-Smtp-Source: AGHT+IEANLovG4G6iCvOEpyLVJDq3I+mCrBJm7iBTA7LiGr6qNgDx0ohT9kUE1fTHJ5jc1hPskdOSQ== X-Received: by 2002:a05:6a00:80e:b0:682:37be:c9fe with SMTP id m14-20020a056a00080e00b0068237bec9femr650875pfk.10.1692397957837; Fri, 18 Aug 2023 15:32:37 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id 7-20020aa79207000000b0068779015507sm1989330pfo.194.2023.08.18.15.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 15:32:37 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann Subject: [edk2-devel] [PATCH v2 21/25] ArmVirtPkg: Apply Memory Protections via SetMemoryProtectionsLib Date: Fri, 18 Aug 2023 15:31:53 -0700 Message-ID: <20230818223159.1073-22-taylor.d.beebe@gmail.com> In-Reply-To: <20230818223159.1073-1-taylor.d.beebe@gmail.com> References: <20230818223159.1073-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="LRcD/tn7"; 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.41.0.windows.3 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107876): https://edk2.groups.io/g/devel/message/107876 Mute This Topic: https://groups.io/mt/100830925/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-