From nobody Mon Feb 9 01:20:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60648+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60648+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1591177948; cv=none; d=zohomail.com; s=zohoarc; b=h+mdogtZ9twH7TshyyK9GNZaNbYP2Q/nghFNBfrrzSy4mbM/yVy+U3PP4mnlaC1lbuPU1mjk5D0ZZTeyZdZROV/Po88IkblU7VpwheIQAYJMGDC7oNczPn7pltBm03qirF5G9W57Z8+Y0mg50w6I4+0EhjvwAJiFXotZLGE6DLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591177948; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mzZcMSGnVzdhUPHrZspJXHSrRgaMgXCo41dzczkRr7Y=; b=HgLR+ljY6OaIYynDbr6y0uZNy+Qeqh4OX+ZVFSlUKvUnsRkTd8bs7hgFZPc+dLGfrtJJs28HRXuwqsbFWC+QdNBNEJepAAgnYwyBtdR/A45VQZV5i4i98Zdl6mJ2lDQWPoVnruP0mNMMnSMOQH4zaHeCtl0wmf1WUEZkePO4GIM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60648+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591177948809402.06304994370123; Wed, 3 Jun 2020 02:52:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mdixYY1788612x6I1iEBu9tc; Wed, 03 Jun 2020 02:52:28 -0700 X-Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by mx.groups.io with SMTP id smtpd.web12.8369.1591167586365820930 for ; Tue, 02 Jun 2020 23:59:46 -0700 X-Received: by mail-pg1-f194.google.com with SMTP id p30so1089261pgl.11 for ; Tue, 02 Jun 2020 23:59:46 -0700 (PDT) X-Gm-Message-State: OZAzKe5s7MfwzCw3joLbKukex1787277AA= X-Google-Smtp-Source: ABdhPJx2n5vu9PurmJLx31ID2Yy2kgblI64AUMg26XUkw3FC7L/eac57pMyKmj9I/Cj9tlU4cfeNTw== X-Received: by 2002:a17:90a:3b09:: with SMTP id d9mr4083141pjc.225.1591167585725; Tue, 02 Jun 2020 23:59:45 -0700 (PDT) X-Received: from localhost.localdomain ([71.212.144.72]) by smtp.gmail.com with ESMTPSA id y6sm1262003pjn.37.2020.06.02.23.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 23:59:45 -0700 (PDT) From: Bret Barkelew X-Google-Original-From: Bret Barkelew To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Liming Gao Subject: [edk2-devel] [PATCH v5 10/14] MdeModulePkg: Allow VariablePolicy state to delete protected variables Date: Tue, 2 Jun 2020 23:58:06 -0700 Message-Id: <20200603065810.806-11-brbarkel@microsoft.com> In-Reply-To: <20200603065810.806-1-brbarkel@microsoft.com> References: <20200603065810.806-1-brbarkel@microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,bret@corthon.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591177948; bh=6bU5XqPLwGgLw0a2z7zKMtneqc/EkXsicTsN5X1DyXI=; h=Cc:Date:From:Reply-To:Subject:To; b=Gi6t0CnF0Q8ga1kZVYAbSAuGD/BKjRWm+SDIObwDyKZ2cnQbkpPLuDKU9Pio5PAVjui 0hN42Z06MguKINaPgN5W0/6cW1m8wcV/FXAMNwXWNejfQ8qwoXhFuwphIxsI8vvIhuTE/ Kr0/o9/rqVyFJdGQ2U9D34iDty9wmQnc+K8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D2522 TcgMorLockSmm provides special protections for the TCG MOR variables. This will check IsVariablePolicyEnabled() before enforcing them to allow variable deletion when policy engine is disabled. Only allows deletion, not modification. Cc: Jian J Wang Cc: Hao A Wu Cc: Liming Gao Cc: Bret Barkelew Signed-off-by: Bret Barkelew --- MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c | 10 += +++++++++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf | 2 ++ 2 files changed, 12 insertions(+) diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/M= deModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c index 6d80eb64341a..085f82035f4b 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c @@ -5,6 +5,7 @@ This module adds Variable Hook and check MemoryOverwriteRequestControlLo= ck. =20 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -17,6 +18,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include "Variable.h" =20 +#include + +#include + typedef struct { CHAR16 *VariableName; EFI_GUID *VendorGuid; @@ -341,6 +346,11 @@ SetVariableCheckHandlerMor ( return EFI_SUCCESS; } =20 + // Permit deletion when policy is disabled. + if (!IsVariablePolicyEnabled() && ((Attributes =3D=3D 0) || (DataSize = =3D=3D 0))) { + return EFI_SUCCESS; + } + // // MorLock variable // diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneM= m.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf index 6e17f6cdf588..d8f480be27cc 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf @@ -20,6 +20,7 @@ # # Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.
# Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -74,6 +75,7 @@ [LibraryClasses] StandaloneMmDriverEntryPoint SynchronizationLib VarCheckLib + VariablePolicyLib =20 [Protocols] gEfiSmmFirmwareVolumeBlockProtocolGuid ## CONSUMES --=20 2.26.2.windows.1.8.g01c50adf56.20200515075929 -=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 (#60648): https://edk2.groups.io/g/devel/message/60648 Mute This Topic: https://groups.io/mt/74646437/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-