From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.130]) by mx.groups.io with SMTP id smtpd.web12.1112.1591681923645836004 for ; Mon, 08 Jun 2020 22:52:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=fyPDr3y8; spf=pass (domain: microsoft.com, ip: 40.107.93.130, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E3v30sTuB9Pg2X+Kb1VemuMY2S2+1EnXO6gOlDK12z5pyB1VTowPr+66ujQWZtbWLBj1mwcF7BLuqMFDcR6j2SY2nez4otMm6TZinmh5umwe5Qh6FnDex37XVdlHjw1N7FTKtwEfDFKKln8b8y/1ZkuVscqr33Iw70BOFIJS0ZuiMGJwFutb+S5DADRU2hEWKLRvVjV4KcSbVM0P3+h+Bb2AqSQM2XY3jdXh2lIFPsYD1NEhfRrbRzJcVeb0trCO4Yepjr2EDj8Tu9WBzY0vhKzD9loRmtEBWHVPAH6k2ry8BypGR+zUET5uweVqhYvGhQw2ZTxdHYKtihnD8itSfw== 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=pJxZetAOsMhne9l/7AW3dX9oCnwRvnEKdieJb9RAMp8=; b=f62wT1d8TQvM3i+cc44ABBTjqdaLnKwxkD4OcwPENkNkGsjXVbXmohdH53OhiMFYNTCvcFOcHizeWpCsFdjJiXyv0XRDHl9x0PnXeqJl3C9d99ECHpdt9YkCYsvOS1KUuwmqNreI5Hkrz1QSLfHIcG5vo4OZs008udkxgmStzR8mNKnBpo/t/F9RFUe4bXYwbb68C5Zhxar66xDDRhwG2QjGzXRwdzfsysbGQ+0nPA+7W6bjMmKjABvpi20+eOHOw5M3MTkCjHjq+CSXDDTPjHoGI4jRjAmNN7uU029qZEIed6wre/y82eYB997zLhdBtwYauLKTlYJ+dkT3jGvINA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pJxZetAOsMhne9l/7AW3dX9oCnwRvnEKdieJb9RAMp8=; b=fyPDr3y8bGgAAdPL2kNp2kYtm/9zPbHYdND+cLuCfIw0chtEX37exQmXo0nMBYQciOoBM/sHyaHM6Y0Z+FVwHH8ZGw27iRgQzOZm3JYur11jXndudNEFKN3cgRzWiLY2ngMnPzHxOfij9F6cn5UWi3mhnjhgQVXQIiYQk300Cu4= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0136.namprd21.prod.outlook.com (2603:10b6:903:b2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.3; Tue, 9 Jun 2020 05:52:01 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::f112:82fb:d4fd:f7dd]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::f112:82fb:d4fd:f7dd%11]) with mapi id 15.20.3088.000; Tue, 9 Jun 2020 05:52:01 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "bret@corthon.com" CC: "Yao, Jiewen" , Chao Zhang , Jian J Wang , Hao A Wu , liming.gao , Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Andrew Fish , "Ni, Ray" Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v5 00/14] Add the VariablePolicy feature Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v5 00/14] Add the VariablePolicy feature Thread-Index: AQHWOYzD3Im0x6HLLE6zmx1jnKqmeKjP0JXi Date: Tue, 9 Jun 2020 05:52:01 +0000 Message-ID: References: <20200603065810.806-1-brbarkel@microsoft.com> In-Reply-To: <20200603065810.806-1-brbarkel@microsoft.com> 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-06-09T05:50:12.5542966Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [71.212.136.24] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e2982e94-1afc-41de-6653-08d80c393ada x-ms-traffictypediagnostic: CY4PR21MB0136: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 042957ACD7 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cQ3xYEqno5V+uoCqRcAm9GCQRUJwAGLl62RWlm+Jy7oCi8nFsm98MFmiDiDd4xYFSA7uU428fuH5ag3G8Z9jHse/EuDTEk8+oXhpIH2EXXQ8bGnzXFVIXULYvEtwMhLWbgr7BHwRvIRrfY5IUWFHlbM7doq8P6aaNJIeosR3MEy5rn/G1eYWqVmH0GqDoiVgf28P9kWfQcHIlX9+xb0k7SK9wTr8akmeknST27Mj46jHGXsHOe7bWS9VS/pIYFerpKo2EQIZg0D1hzvR29hF+AFfx1jXMTTKkLktBInAG1YrTptkrfLesLNBITG/Ed9IwEzqXu1sbGjNxQWGX8uU0xu03uf/BY1OhZCdmKpUZiouED3plsuuUYhTKlOHS0Hyi1RLYAX5kA/njzhFTGx9rQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(396003)(136003)(376002)(346002)(366004)(2906002)(110136005)(4326008)(8936002)(91956017)(76116006)(64756008)(66446008)(71200400001)(83380400001)(186003)(26005)(7416002)(53546011)(7696005)(316002)(66946007)(66556008)(54906003)(6506007)(10290500003)(52536014)(55016002)(9686003)(478600001)(82960400001)(66476007)(86362001)(166002)(8990500004)(8676002)(30864003)(33656002)(5660300002)(82950400001)(966005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: nkFXfutbiaG9JayK4GTFQMhOBWrE2Bf2yZYrjygDwoPW3K+/Vs01ag9FJGXQ248jFWbgoV3aZm6uZRITLXIcWv26NpQ1SUqsTMREAI6j9nXRyihmUtxb1fS3V+fAXf74rIPWBlK5u/Z6mI0KRyCU/SejT5xnbXmvz/T+l9SCsSJOvWJ+SgXnCLS5FO6Jfdok/b5C75IRjXSOdNkKMsJhi+LVslmyAKC+PjjKmBmLCmfpmZ9qDE9L8woL0FB1lCXwtxTE/L1qSkXWMBGd2mRCCrZpyKUNvP4q1SOAihZsv13yTEP1EywaRIWW9RIWhcYtJuFRC1R1ut0Vxw1OA4DEMgQHmdhu2GRsqE/dfSzWrTZ6K43cxUWNVetGadxqGl1aToegp6Iwoewew8Tj+Hvb0MlManvQ29fYN0wQaD+RakGaHE3rM8NJRMUyjmgxMWZrhIjuAZaIqQLenHVRLWKWA+CxsDFltJSKG9xE0dGNOpmPqce9Sps3yHSE99FMulaC x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2982e94-1afc-41de-6653-08d80c393ada X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jun 2020 05:52:01.1686 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2noahvLezu158+Q4RPC/GcvS40tiU4geEArJDabDZHMOQKtKQ+8lohNJW7dDLnESugEKbxCxUOpEmLyAi+OS2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0136 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB074395788EA59449178C271FEF820CY4PR21MB0743namp_" --_000_CY4PR21MB074395788EA59449178C271FEF820CY4PR21MB0743namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Bump. Now that the stable tag is behind us, I=92d like to get this in to have ma= ximum time before the next stable tag. I think the only reviews I=92ve seen so far are for the platform integrati= ons (Arm, Ovmf, and Embedded). Need more eyeballs, please and thank you! - Bret From: Bret Barkelew via groups.io Sent: Wednesday, June 3, 2020 2:52 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 v5 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%7C90bcb822fa054686203008d807a3e4ee%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637267747784879051&sdata=3Dk9X9qPTDTQlno5%= 2Ff4koMn6bE9s6nTOIlJ886PQRw%2Bzc%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%7C90bcb822fa054686203008d807a3e4ee%7C72f98= 8bf86f141af91ab2d7cd011db47%7C1%7C0%7C637267747784879051&sdata=3DeIQjfZ= JQGTECXzETa1iZ3T9vOdNiNEjIzVrjhDR%2B2CE%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%7C90bcb822fa054686203008d807a3e4ee%7C72f988bf86f141af91ab2d7= cd011db47%7C1%7C0%7C637267747784879051&sdata=3DrhwUXzkU%2B71sFkomJvPzi4= IN6hz2JKIbDBnNt0wCJS8%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 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 = | 813 +++++++ MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePol= icyUnitTest.c | 2436 ++++++++++++++++++++ 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, 8008 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_CY4PR21MB074395788EA59449178C271FEF820CY4PR21MB0743namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Bump.

Now that the stable tag is behind us, I=92d like to= get this in to have maximum time before the next stable tag.

 

I think the only reviews I=92ve seen so far are for= the platform integrations (Arm, Ovmf, and Embedded). Need more eyeballs, p= lease and thank you!

 

- Bret

 

From: Bret Barkelew via groups.io=
Sent: Wednesday, June 3, 2020 2:52 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 v5 00/14] Add the VariableP= olicy feature

 

REF:https://nam06.sa= felinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzilla.tianocore.org%= 2Fshow_bug.cgi%3Fid%3D2522&amp;data=3D02%7C01%7Cbret.barkelew%40microso= ft.com%7C90bcb822fa054686203008d807a3e4ee%7C72f988bf86f141af91ab2d7cd011db4= 7%7C1%7C0%7C637267747784879051&amp;sdata=3Dk9X9qPTDTQlno5%2Ff4koMn6bE9s= 6nTOIlJ886PQRw%2Bzc%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-Prot= ocol---Enhanced-Method-for-Managing-Variables%23platform-porting&amp;da= ta=3D02%7C01%7Cbret.barkelew%40microsoft.com%7C90bcb822fa054686203008d807a3= e4ee%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637267747784879051&am= p;sdata=3DeIQjfZJQGTECXzETa1iZ3T9vOdNiNEjIzVrjhDR%2B2CE%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://n= am06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.groups.io%2= Fg%2Fdevel%2Fmessage%2F53712&amp;data=3D02%7C01%7Cbret.barkelew%40micro= soft.com%7C90bcb822fa054686203008d807a3e4ee%7C72f988bf86f141af91ab2d7cd011d= b47%7C1%7C0%7C637267747784879051&amp;sdata=3DrhwUXzkU%2B71sFkomJvPzi4IN= 6hz2JKIbDBnNt0wCJS8%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@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Bret Barkelew <brbarkel@microsoft.com>
Signed-off-by: Bret Barkelew <brbarkel@microsoft.com>

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;    |  813 +++++++
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/Variab= lePolicyUnitTest.c   | 2436 +++++++&#= 43;++++++++++++
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicy= FuncTestApp.c        | 1978 ++&#= 43;+++++++++++++
 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 &#= 43;+++++
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c&n= bsp;            = ;          |   14 &#= 43;
 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 &#= 43;
 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 &#= 43;
 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 &#= 43;
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc    &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;      |    4 +
 47 files changed, 8008 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_CY4PR21MB074395788EA59449178C271FEF820CY4PR21MB0743namp_--