From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web12.5175.1596072979957129754 for ; Wed, 29 Jul 2020 18:36:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=lkYwan1e; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: liming.gao@intel.com) IronPort-SDR: ULzBzFtF6B7fOqUr5PL1Ey4WRncNOHEddvEIYcKRz3l0kYUdv85Z5pGS3M+0w11UU01aSZcc11 1QhG+oSc2Vxg== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="149359010" X-IronPort-AV: E=Sophos;i="5.75,412,1589266800"; d="scan'208,217";a="149359010" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 18:36:18 -0700 IronPort-SDR: Ma5eDPhXLEKaknrooTS3hHraehwafoLpDroC+i8DjKQ9pF1aHr6MndtO4j8Vnr97E+rI+y2Eet iuMMineKPp5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,412,1589266800"; d="scan'208,217";a="304409054" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga002.jf.intel.com with ESMTP; 29 Jul 2020 18:36:18 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Jul 2020 18:36:18 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 29 Jul 2020 18:36:17 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 29 Jul 2020 18:36:17 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Jul 2020 18:36:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZGjb4ZaoUk0Ag+LYkUgv4En81J6y8yYyJp/YicuummIgy9duX3WmS+JQi6BKx6hbNR2hxc4K4fWjl1U5Dyow436DHSPORrJa2sNKBSzSRiTwTXI02h6dQEg1/cLcXwDTNd0YsiZQC93t1iPqTP3vQ3ophlLgRKDzA1U9Ogj0NpBT4ksesvk3arfQY2zK5KtNmhH+G0bTDZzKq38ucQZ7/b3FXlZOw7BUXGrjxO7KKsi7L75wLwFSpFYFEAPpsJImXp5TP1iHziUFGgvl9NEmc4qI72+X7MKsBL7X+q9R0Kfd0Q5QJZdlkUevLQv6ZHDGkwNyKhLIIi6HtBISyo3uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2RQG4YQCWVHUnKAovshPEPBIuQ3dI/F/TZJDLluIMaw=; b=KEcJsZX2bLpp2QjD56ss+odDsrwLTo9sFl05T8Az8gS1/y4/xbpBrt4JN19BsLmLDzN54wxEUnV3UL1Nhw0JR+CK0tYhIBhmIeNq0ObAUYWVdJXzpiBwgKw2MKo+PRyyMAnVLD4Z4Dkb+g8GDpFagriAkxeckpGFP6S6sqVyO71s0BXMCcie2+5qpaMTEaKagNbsa8nJZkU9RWbMNNUfWUeGwvXBuQGIqEp/ENdHnHQo5Mzg5kQHKMGvtE04rm2YpM6M26AvQzm1XDJvgboUwOuV9VyTwhryGE78+P3+Qs4gIwoNRTBe3pQDrKAN1MDpF96v8jByLT6lHBuJbi9MOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2RQG4YQCWVHUnKAovshPEPBIuQ3dI/F/TZJDLluIMaw=; b=lkYwan1e65c5SGfTomT/5Ib2iTJ6AU+1bjHJa33arm5hjStNjwd7SK69PKI53w7vUlI6iFc/V2oANhm5cVvopWgCV77RrYLhv30jzUS1b6bxTVDULDvfWkUGzZCkqJvGx5lAhxpM6ESmGQuaRj9T4ryOdsH3geMTxXZExVwNVVw= Received: from CY4PR11MB1526.namprd11.prod.outlook.com (2603:10b6:910:7::10) by CY4PR11MB2007.namprd11.prod.outlook.com (2603:10b6:903:30::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.25; Thu, 30 Jul 2020 01:36:15 +0000 Received: from CY4PR11MB1526.namprd11.prod.outlook.com ([fe80::f8c4:711:84e3:4c97]) by CY4PR11MB1526.namprd11.prod.outlook.com ([fe80::f8c4:711:84e3:4c97%4]) with mapi id 15.20.3216.034; Thu, 30 Jul 2020 01:36:14 +0000 From: "Liming Gao" To: "devel@edk2.groups.io" , "bret.barkelew@microsoft.com" , "bret@corthon.com" , Leif Lindholm CC: "Yao, Jiewen" , "Wang, Jian J" , "Wu, Hao A" , "Justen, Jordan L" , Laszlo Ersek , Ard Biesheuvel , Andrew Fish , "Ni, Ray" Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature Thread-Index: AQHWSSlW0ZOGgWBeeUGjK+sbsN3TKKkfMloAgABeHmA= Date: Thu, 30 Jul 2020 01:36:14 +0000 Message-ID: References: <20200623064104.1908-1-brbarkel@microsoft.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-07-29T19:54:45.9373124Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd569a32-6ae0-49ed-f6bc-08d83428f2cd x-ms-traffictypediagnostic: CY4PR11MB2007: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h4HrM1LjXFx68tI9tAQdzGAmx9zCJWICXjNBFFgospm6DnQY1Fwq2Ekizq6tdv3Wz+P5wV49fLck1tP/yIhYu/jQO0EEfHPqUjXn/0sCJCTGJjoQ5xzga49Q1dIVf4nL6bjWEpk3/Nht9Wc98KLBRdQKlf8b+Slu+JoRaytX4qIqewXr4a26wpnCeV5qUbwyqnuNiSUNtrwV1npnhOQ67g6CG60OdPYChOBM8NUaZL81sF8ucr71swRjaFLj+3asX68u9Kc1PLyuEkhpK1xGTDDcNvWjspUyuU/TfgU/Hr4mDJOAhiGber0hjubYtSQ5iGvi+87OJvQNpaoqESczO8GA7lLaZ4n29dfUlfTtIdIXIf4s+iIufwvvf4Fu0kB2egMrU5vwaag8lA+OpLiyDQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1526.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(136003)(346002)(396003)(39860400002)(376002)(478600001)(5660300002)(45080400002)(55016002)(30864003)(9686003)(8936002)(966005)(4326008)(52536014)(8676002)(107886003)(110136005)(66476007)(66946007)(186003)(54906003)(83380400001)(71200400001)(2906002)(86362001)(33656002)(64756008)(66556008)(76116006)(316002)(76236003)(7696005)(26005)(166002)(66446008)(6506007)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: +x4FvMjiSeyFWytOqIPCL3BGz94AmgvBzSXYyihWokc80zJVeb84zAYIPfHkM64g7ENv5KtlgZBmhGWsn4TqbLmmd6br+gY7qitRYRs3pmvlzaz5oXid8jQMHVA0dIeJVnhtwfr7rOVQ7N0ACO53JaBardEI3DlNkvk5FoNSqaiSsLTYHydnnH+JpQ3QLvywNKxzNHmS/pwiah8C/qJR096z74vQlZ6rFMDebXM+MixVGE6iZxL3YOmiWmq4spZxozT2XmCG7+7UYy9CbR+pxCYSyo4nJC9rRCfsawJwdXHfgMPiFpZrzpidpZKs8jb6BPd4iJ4QMcHX4XErZqIDVsEcD+67HBDCUDIRjsF2624MccYrBH2oeFa+htAxXhLpb/tgWbgcCLkErACKRE0y5ZhobyZEsptrDccHxsc+EL4DelNATzD81ypjbuOReBRitnzoyu9lQ8a2mMJHLnNt39NuYCdQOAaJtjB3fKuewN5ZhzWQoxot+OrJTi/nm9aw MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1526.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd569a32-6ae0-49ed-f6bc-08d83428f2cd X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2020 01:36:14.8106 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: AnVut/E5MtOhtNj28na9po+ECgSaALtStVsUqn0T8UJIV9dtaHtoC+GOjnY+b6Zzo3gqO9wGKTGA1M73SuONAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB2007 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR11MB15269746955EA857701A184880710CY4PR11MB1526namp_" --_000_CY4PR11MB15269746955EA857701A184880710CY4PR11MB1526namp_ Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Include Leif. This change adds new library class dependency for the variabl= e driver. So, it requires to update the platform DSC file. It will impact A= RM platforms. Thanks Liming From: devel@edk2.groups.io On Behalf Of Bret Barkel= ew via groups.io Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B30=1B$BF|=1B(B 3:56 To: devel@edk2.groups.io; bret@corthon.com Cc: Yao, Jiewen ; Chao Zhang ; Wang, Jian J ; Wu, Hao A ; Ga= o, Liming ; Justen, Jordan L ; Laszlo Ersek ; Ard Biesheuvel ; Andrew Fish ; Ni, Ray Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePoli= cy feature Still waiting on some R-bs. Have a new doc that will make it into a v7, if it helps anyone with their = review=1B$B!D=1B(B https://github.com/microsoft/mu_basecore/blob/release/202005/MdeModulePkg/= Universal/Variable/UefiVariablePolicy/ReadMe.md Thanks! - Bret From: Bret Barkelew via groups.io Sent: Tuesday, June 23, 2020 4:19 AM To: devel@edk2.groups.io Cc: Yao, Jiewen; Chao Zhang; Jian J Wang; Hao A Wu; liming.gao; Jordan Justen<= mailto:jordan.l.justen@intel.com>; Laszlo Ersek; = Ard Biesheuvel; Andrew Fish; Ni, Ray Subject: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy f= eature REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2522&data=3D02%7C01%7Cbret.b= arkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=3D1%2F3MkPm5HuXeG= %2FEaQgl%2F%2F8Tqu3UvgDs6Ich2ezXgjuY%3D&reserved=3D0 The 14 patches in this series add the VariablePolicy feature to the core, deprecate Edk2VarLock (while adding a compatibility layer to reduce code churn), and integrate the VariablePolicy libraries and protocols into Variable Services. Since the integration requires multiple changes, including adding librarie= s, a protocol, an SMI communication handler, and VariableServices integration= , the patches are broken up by individual library additions and then a final integration. Security-sensitive changes like bypassing Authenticated Variable enforcement are also broken out into individual patches so that attention can be called directly to them. Platform porting instructions are described in this wiki entry: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub= .com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-Protocol---E= nhanced-Method-for-Managing-Variables%23platform-porting&data=3D02%7C01= %7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f98= 8bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&sdata=3Db%2FFd= g6Sy2pdxbk3C%2FgVzXvoOWOxW6Z60QXRQ%2BVxGfFs%3D&reserved=3D0 Discussion of the feature can be found in multiple places throughout the last year on the RFC channel, staging branches, and in devel. Most recently, this subject was discussed in this thread: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.g= roups.io%2Fg%2Fdevel%2Fmessage%2F53712&data=3D02%7C01%7Cbret.barkelew%4= 0microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7= cd011db47%7C1%7C0%7C637285079522114249&sdata=3DepDJobMGos0As5T2JSwhs2PT= y1IDt52oLqXkxEPJWLg%3D&reserved=3D0 (the code branches shared in that discussion are now out of date, but the whitepapers and discussion are relevant). Cc: Jiewen Yao > Cc: Chao Zhang > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Liming Gao > Cc: Jordan Justen > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Andrew Fish > Cc: Ray Ni > Cc: Bret Barkelew > Signed-off-by: Bret Barkelew > v6 changes: * Fix an issue with uninitialized Status in InitVariablePolicyLib() and De= initVariablePolicyLib() * Fix GCC building in shell-based functional test * Rebase on latest origin/master v5 changes: * Fix the CONST mismatch in VariablePolicy.h and VariablePolicySmmDxe.c * Fix EFIAPI mismatches in the functional unittest * Rebase on latest origin/master v4 changes: * Remove Optional PcdAllowVariablePolicyEnforcementDisable PCD from platfo= rms * Rebase on master * Migrate to new MmCommunicate2 protocol * Fix an oversight in the default return value for InitMmCommonCommBuffer * Fix in VariablePolicyLib to allow ExtraInitRuntimeDxe to consume variabl= es V3 changes: * Address all non-unittest issues with ECC * Make additional style changes * Include section name in hunk headers in "ini-style" files * Remove requirement for the EdkiiPiSmmCommunicationsRegionTable driver (now allocates its own buffer) * Change names from VARIABLE_POLICY_PROTOCOL and gVariablePolicyProtocolGu= id to EDKII_VARIABLE_POLICY_PROTOCOL and gEdkiiVariablePolicyProtocolGuid * Fix GCC warning about initializing externs * Add UNI strings for new PCD * Add patches for ArmVirtPkg, OvmfXen, and UefiPayloadPkg * Reorder patches according to Liming's feedback about adding to platforms before changing variable driver V2 changes: * Fixed implementation for RuntimeDxe * Add PCD to block DisableVariablePolicy * Fix the DumpVariablePolicy pagination in SMM Bret Barkelew (14): MdeModulePkg: Define the VariablePolicy protocol interface MdeModulePkg: Define the VariablePolicyLib MdeModulePkg: Define the VariablePolicyHelperLib MdeModulePkg: Define the VarCheckPolicyLib and SMM interface OvmfPkg: Add VariablePolicy engine to OvmfPkg platform EmulatorPkg: Add VariablePolicy engine to EmulatorPkg platform ArmVirtPkg: Add VariablePolicy engine to ArmVirtPkg platform UefiPayloadPkg: Add VariablePolicy engine to UefiPayloadPkg platform MdeModulePkg: Connect VariablePolicy business logic to VariableServices MdeModulePkg: Allow VariablePolicy state to delete protected variables SecurityPkg: Allow VariablePolicy state to delete authenticated variables MdeModulePkg: Change TCG MOR variables to use VariablePolicy MdeModulePkg: Drop VarLock from RuntimeDxe variable driver MdeModulePkg: Add a shell-based functional test for VariablePolicy MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c = | 320 +++ MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c = | 396 ++++ MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitNull.c = | 46 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitRuntimeDxe.= c | 85 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c = | 816 +++++++ MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePol= icyUnitTest.c | 2440 ++++++++++++++++++++ MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyFuncT= estApp.c | 1978 ++++++++++++++++ MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c = | 52 +- MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c = | 60 +- MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c = | 49 +- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c = | 53 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequstToLock.c = | 71 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c = | 642 +++++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c = | 14 + SecurityPkg/Library/AuthVariableLib/AuthService.c = | 22 +- ArmVirtPkg/ArmVirt.dsc.inc = | 4 + EmulatorPkg/EmulatorPkg.dsc = | 3 + MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h = | 54 + MdeModulePkg/Include/Library/VariablePolicyHelperLib.h = | 164 ++ MdeModulePkg/Include/Library/VariablePolicyLib.h = | 207 ++ MdeModulePkg/Include/Protocol/VariablePolicy.h = | 157 ++ MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf = | 42 + MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.uni = | 12 + MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf = | 35 + MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.uni = | 12 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf = | 44 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.uni = | 12 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf = | 51 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePol= icyUnitTest.inf | 40 + MdeModulePkg/MdeModulePkg.ci.yaml = | 4 +- MdeModulePkg/MdeModulePkg.dec = | 26 +- MdeModulePkg/MdeModulePkg.dsc = | 15 + MdeModulePkg/MdeModulePkg.uni = | 7 + MdeModulePkg/Test/MdeModulePkgHostTest.dsc = | 11 + MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/Readme.md = | 55 + MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyFuncT= estApp.inf | 42 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf = | 5 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf = | 4 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf = | 10 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf = | 4 + OvmfPkg/OvmfPkgIa32.dsc = | 5 + OvmfPkg/OvmfPkgIa32X64.dsc = | 5 + OvmfPkg/OvmfPkgX64.dsc = | 5 + OvmfPkg/OvmfXen.dsc = | 4 + SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf = | 2 + UefiPayloadPkg/UefiPayloadPkgIa32.dsc = | 4 + UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc = | 4 + 47 files changed, 8015 insertions(+), 78 deletions(-) create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyL= ib.c create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/VariableP= olicyHelperLib.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyE= xtraInitNull.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyE= xtraInitRuntimeDxe.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyU= nitTest/VariablePolicyUnitTest.c create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/= VariablePolicyFuncTestApp.c create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLoc= kRequstToLock.c create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePol= icySmmDxe.c create mode 100644 MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h create mode 100644 MdeModulePkg/Include/Library/VariablePolicyHelperLib.h create mode 100644 MdeModulePkg/Include/Library/VariablePolicyLib.h create mode 100644 MdeModulePkg/Include/Protocol/VariablePolicy.h create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyL= ib.inf create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyL= ib.uni create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/VariableP= olicyHelperLib.inf create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/VariableP= olicyHelperLib.uni create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.uni create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ibRuntimeDxe.inf create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyU= nitTest/VariablePolicyUnitTest.inf create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/= Readme.md create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/= VariablePolicyFuncTestApp.inf -- 2.26.2.windows.1.8.g01c50adf56.20200515075929 --_000_CY4PR11MB15269746955EA857701A184880710CY4PR11MB1526namp_ Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable

Include Leif. This change adds new library class dependen= cy for the variable driver. So, it requires to update the platform DSC file= . It will impact ARM platforms.

 

Thanks

Liming

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bret Barkelew via groups.io
Sent: 2020
=1B$BG/=1B(B7=1B$B7n=1B(B30=1B$BF|=1B(B 3:56
To: devel@edk2.groups.io; bret@corthon.com
Cc: Yao, Jiewen <jiewen.yao@intel.com>; Chao Zhang <chao.b= .zhang@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A= <hao.a.wu@intel.com>; Gao, Liming <liming.gao@intel.com>; Just= en, Jordan L <jordan.l.justen@intel.com>; Laszlo Ersek <lersek@red= hat.com>; Ard Biesheuvel <ard.biesheuvel@arm.com>; Andrew Fish <afish@appl= e.com>; Ni, Ray <ray.ni@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the Varia= blePolicy feature

 

Still waiting on some R-bs.

 

Have a new doc that will make = it into a v7, if it helps anyone with their review=1B$B!D=1B(B

https://github.com/microsoft/mu_basecore/blob/= release/202005/MdeModulePkg/Universal/Variable/UefiVariablePolicy/ReadMe.md=

 

Thanks!

 

- Bret

 

From: Bret Barkelew v= ia groups.io
Sent: Tuesday, June 23, 2020 4:19 AM
To: devel@edk2.groups.io
Cc:
Yao, Jiewen; Chao Zhang; Jian J Wang; = Hao A Wu; liming.gao; Jordan Justen; Laszlo Ersek; = Ard Biesheuvel; Andrew Fish; Ni, Ray
Subject: [EXTERNAL] [edk2-devel] [PATCH v6 00/14] Add the VariableP= olicy feature

 

REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2522&amp;data=3D02%7C01%7Cbr= et.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86= f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&amp;sdata=3D1%2F3Mk= Pm5HuXeG%2FEaQgl%2F%2F8Tqu3UvgDs6Ich2ezXgjuY%3D&amp;reserved=3D0

The 14 patches in this series add the VariablePolicy feature to the core,<= br> deprecate Edk2VarLock (while adding a compatibility layer to reduce code churn), and integrate the VariablePolicy libraries and protocols into
Variable Services.

Since the integration requires multiple changes, including adding librarie= s,
a protocol, an SMI communication handler, and VariableServices integration= ,
the patches are broken up by individual library additions and then a final=
integration. Security-sensitive changes like bypassing Authenticated
Variable enforcement are also broken out into individual patches so that attention can be called directly to them.

Platform porting instructions are described in this wiki entry:
https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A= %2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FVariablePolicy-= Protocol---Enhanced-Method-for-Managing-Variables%23platform-porting&am= p;data=3D02%7C01%7Cbret.barkelew%40microsoft.com%7Cdf2ee1dbc25a4810f5ce08d8= 17674112%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637285079522114249&am= p;amp;sdata=3Db%2FFdg6Sy2pdxbk3C%2FgVzXvoOWOxW6Z60QXRQ%2BVxGfFs%3D&amp;= reserved=3D0

Discussion of the feature can be found in multiple places throughout
the last year on the RFC channel, staging branches, and in devel.

Most recently, this subject was discussed in this thread:
https://nam= 06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.groups.io%2Fg= %2Fdevel%2Fmessage%2F53712&amp;data=3D02%7C01%7Cbret.barkelew%40microso= ft.com%7Cdf2ee1dbc25a4810f5ce08d817674112%7C72f988bf86f141af91ab2d7cd011db4= 7%7C1%7C0%7C637285079522114249&amp;sdata=3DepDJobMGos0As5T2JSwhs2PTy1ID= t52oLqXkxEPJWLg%3D&amp;reserved=3D0
(the code branches shared in that discussion are now out of date, but the<= br> whitepapers and discussion are relevant).

Cc: Jiewen Yao <jiewen.yao@inte= l.com>
Cc: Chao Zhang <chao.b.zhang@= intel.com>
Cc: Jian J Wang <jian.j.wang@i= ntel.com>
Cc: Hao A Wu <hao.a.wu@intel.com<= /a>>
Cc: Liming Gao <
liming.gao@inte= l.com>
Cc: Jordan Justen <jordan.= l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.co= m>
Cc: Ard Biesheuvel <ard.biesh= euvel@arm.com>
Cc: Andrew Fish <afish@apple.com= >
Cc: Ray Ni <ray.ni@intel.com>= ;
Cc: Bret Barkelew <brbarkel@m= icrosoft.com>
Signed-off-by: Bret Barkelew <brbarkel@microsoft.com>

v6 changes:
* Fix an issue with uninitialized Status in InitVariablePolicyLib() and De= initVariablePolicyLib()
* Fix GCC building in shell-based functional test
* Rebase on latest origin/master

v5 changes:
* Fix the CONST mismatch in VariablePolicy.h and VariablePolicySmmDxe.c * Fix EFIAPI mismatches in the functional unittest
* Rebase on latest origin/master

v4 changes:
* Remove Optional PcdAllowVariablePolicyEnforcementDisable PCD from platfo= rms
* Rebase on master
* Migrate to new MmCommunicate2 protocol
* Fix an oversight in the default return value for InitMmCommonCommBuffer<= br> * Fix in VariablePolicyLib to allow ExtraInitRuntimeDxe to consume variabl= es

V3 changes:
* Address all non-unittest issues with ECC
* Make additional style changes
* Include section name in hunk headers in "ini-style" files
* Remove requirement for the EdkiiPiSmmCommunicationsRegionTable driver   (now allocates its own buffer)
* Change names from VARIABLE_POLICY_PROTOCOL and gVariablePolicyProtocolGu= id
  to EDKII_VARIABLE_POLICY_PROTOCOL and gEdkiiVariablePolicyProtocolG= uid
* Fix GCC warning about initializing externs
* Add UNI strings for new PCD
* Add patches for ArmVirtPkg, OvmfXen, and UefiPayloadPkg
* Reorder patches according to Liming's feedback about adding to platforms=
  before changing variable driver

V2 changes:
* Fixed implementation for RuntimeDxe
* Add PCD to block DisableVariablePolicy
* Fix the DumpVariablePolicy pagination in SMM

Bret Barkelew (14):
  MdeModulePkg: Define the VariablePolicy protocol interface
  MdeModulePkg: Define the VariablePolicyLib
  MdeModulePkg: Define the VariablePolicyHelperLib
  MdeModulePkg: Define the VarCheckPolicyLib and SMM interface
  OvmfPkg: Add VariablePolicy engine to OvmfPkg platform
  EmulatorPkg: Add VariablePolicy engine to EmulatorPkg platform
  ArmVirtPkg: Add VariablePolicy engine to ArmVirtPkg platform
  UefiPayloadPkg: Add VariablePolicy engine to UefiPayloadPkg platfor= m
  MdeModulePkg: Connect VariablePolicy business logic to
    VariableServices
  MdeModulePkg: Allow VariablePolicy state to delete protected variab= les
  SecurityPkg: Allow VariablePolicy state to delete authenticated
    variables
  MdeModulePkg: Change TCG MOR variables to use VariablePolicy
  MdeModulePkg: Drop VarLock from RuntimeDxe variable driver
  MdeModulePkg: Add a shell-based functional test for VariablePolicy<= br>
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.c &nbs= p;            &= nbsp;           &nbs= p;    |  320 +++
 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib= .c            &= nbsp;      |  396 ++++
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitNull.c=             &nb= sp;        |   46 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitRuntim= eDxe.c           &nb= sp;   |   85 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c &nbs= p;            &= nbsp;           &nbs= p;    |  816 +++++++
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/Variab= lePolicyUnitTest.c   | 2440 ++++++++++++++++++++
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicy= FuncTestApp.c        | 1978 ++++++++++++= ++++
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c &nbs= p;            &= nbsp;           &nbs= p;    |   52 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c &nbs= p;            &= nbsp;           &nbs= p;    |   60 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c  &nb= sp;            =             &nb= sp;        |   49 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c  =             &nb= sp;            =       |   53 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequstToLock.= c            &n= bsp;       |   71 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c&nb= sp;            =            |  642 ++= +++
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c&n= bsp;            = ;          |   14 +<= br>  SecurityPkg/Library/AuthVariableLib/AuthService.c   &= nbsp;           &nbs= p;            &= nbsp;           | &n= bsp; 22 +-
 ArmVirtPkg/ArmVirt.dsc.inc       =             &nb= sp;            =             &nb= sp;            =       |    4 +
 EmulatorPkg/EmulatorPkg.dsc       = ;            &n= bsp;            = ;            &n= bsp;            = ;     |    3 +
 MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h    = ;            &n= bsp;            = ;            &n= bsp;  |   54 +
 MdeModulePkg/Include/Library/VariablePolicyHelperLib.h  &n= bsp;            = ;            &n= bsp;       |  164 ++
 MdeModulePkg/Include/Library/VariablePolicyLib.h   &n= bsp;            = ;            &n= bsp;            |&nb= sp; 207 ++
 MdeModulePkg/Include/Protocol/VariablePolicy.h   &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp; |  157 ++
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf &n= bsp;            = ;            &n= bsp;  |   42 +
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.uni &n= bsp;            = ;            &n= bsp;  |   12 +
 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib= .inf            = ;     |   35 +
 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib= .uni            = ;     |   12 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf &n= bsp;            = ;            &n= bsp;  |   44 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.uni &n= bsp;            = ;            &n= bsp;  |   12 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.i= nf            &= nbsp;      |   51 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/Variab= lePolicyUnitTest.inf |   40 +
 MdeModulePkg/MdeModulePkg.ci.yaml      = ;            &n= bsp;            = ;            &n= bsp;            |&nb= sp;   4 +-
 MdeModulePkg/MdeModulePkg.dec      &nb= sp;            =             &nb= sp;            =             &nb= sp;   |   26 +-
 MdeModulePkg/MdeModulePkg.dsc      &nb= sp;            =             &nb= sp;            =             &nb= sp;   |   15 +
 MdeModulePkg/MdeModulePkg.uni      &nb= sp;            =             &nb= sp;            =             &nb= sp;   |    7 +
 MdeModulePkg/Test/MdeModulePkgHostTest.dsc    &n= bsp;            = ;            &n= bsp;            = ;     |   11 +
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/Readme.md = ;            &n= bsp;            |&nb= sp;  55 +
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicy= FuncTestApp.inf      |   42 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf&nb= sp;            =            |  &= nbsp; 5 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf &nbs= p;            &= nbsp;           &nbs= p;    |    4 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf=             &nb= sp;        |   10 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf&= nbsp;           &nbs= p;         |    4 +<= br>  OvmfPkg/OvmfPkgIa32.dsc       &nb= sp;            =             &nb= sp;            =             &nb= sp;        |    5 +
 OvmfPkg/OvmfPkgIa32X64.dsc       =             &nb= sp;            =             &nb= sp;            =       |    5 +
 OvmfPkg/OvmfPkgX64.dsc       &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;         |    5 +<= br>  OvmfPkg/OvmfXen.dsc        &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           | &n= bsp;  4 +
 SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf  &= nbsp;           &nbs= p;            &= nbsp;      |    2 +
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc     &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;         |    4 +<= br>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc    &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;      |    4 +
 47 files changed, 8015 insertions(+), 78 deletions(-)
 create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPo= licyLib.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/Vari= ablePolicyHelperLib.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyExtraInitNull.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyExtraInitRuntimeDxe.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyLib.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyUnitTest/VariablePolicyUnitTest.c
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTes= tApp/VariablePolicyFuncTestApp.c
 create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/Variab= leLockRequstToLock.c
 create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/Variab= lePolicySmmDxe.c
 create mode 100644 MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h
 create mode 100644 MdeModulePkg/Include/Library/VariablePolicyHelper= Lib.h
 create mode 100644 MdeModulePkg/Include/Library/VariablePolicyLib.h<= br>  create mode 100644 MdeModulePkg/Include/Protocol/VariablePolicy.h  create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPo= licyLib.inf
 create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPo= licyLib.uni
 create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/Vari= ablePolicyHelperLib.inf
 create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/Vari= ablePolicyHelperLib.uni
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyLib.inf
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyLib.uni
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyLibRuntimeDxe.inf
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePo= licyUnitTest/VariablePolicyUnitTest.inf
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTes= tApp/Readme.md
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTes= tApp/VariablePolicyFuncTestApp.inf

--
2.26.2.windows.1.8.g01c50adf56.20200515075929

 

--_000_CY4PR11MB15269746955EA857701A184880710CY4PR11MB1526namp_--