From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.111]) by mx.groups.io with SMTP id smtpd.web12.6883.1600841540702884736 for ; Tue, 22 Sep 2020 23:12:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=EjeY+xti; spf=pass (domain: microsoft.com, ip: 40.107.220.111, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ou2z9K7ScoviAzEkNM/yEB4CUUDbrG3kK0qMYrhgXiZ3UmfSpOljXWWJcojam3ETUPxhBloMSAlSIDb9YNrP0FfYH+zF0mS74HcS17HAYqktY9JWrVk3vbJxSXE/VKIvcTeT3b42zMlMQbR+KZDU7dm/IK4Zs37+HLI/Yzcv6PP9VRZ0gvqcX+KCyzUrcYSOM5KSKyzyjrJlPYBTyIvk5Z3HBBAihiYQfyxcYk5vzhZWcOLO+T86gvcyedDwL8JKMr77U5pmJzB1f50CrMqRSJmNSVMa6Jq+OJS3tsg4SyCO8HhZsDg6tr+OnHUlUSMbY/7v+zcbc/oKrpfWjHFMQg== 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=TaJQ4Wdrt32bV5Q9VBMHbGrWcSNEuWfgnJYMsDUYGos=; b=gFb2idsVHsFHmE3F3hMu/rsrjKO/2znD0qSx873VdCUO8Xpe52hx9vzXfi8GBMfRrfR2gs2HjdDz2558DifKs2Syf/awqsary2et8XBhJXUPlXqhzpNXkPxQtZrbsSo+KCjQV+WG55eBCVqq3NEzzBALxSlGm8J7aJP6+6511/pZctOsj62qVPpGH1Ro6jNQUeeMRLVhEKXUd/aYrnkNnESsEafdE5PJdMll4j0ZHCTB9tith7RRdc0s8UxoYLvrvBrf4ZxfJbMd6Y8Vt4HxqKSq/fhp0iCUT5W8aErcuayh8syAdPLne/AAHBwRJl2BjVh5AaSZMSR55nBaHFenKg== 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=TaJQ4Wdrt32bV5Q9VBMHbGrWcSNEuWfgnJYMsDUYGos=; b=EjeY+xtisr+HhJNeqtJ+BcxvZMjvfPi5dhFQ/y1ZaPBxDMYvHo4N7IRaOEU8Dwhwr/rfCoBanjVNuR5DjAswJMaH/DXiBuZgkWzLElB6M4ZXA2yuV3QMJLAAPrMoih/3kICh4lOGwzVolmxl5bPQXARWEEx49d1WUL+yW3tzoi4= Received: from MW4PR21MB1857.namprd21.prod.outlook.com (2603:10b6:303:74::12) by MW2PR2101MB1115.namprd21.prod.outlook.com (2603:10b6:302:a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.1; Wed, 23 Sep 2020 06:12:12 +0000 Received: from MW4PR21MB1857.namprd21.prod.outlook.com ([fe80::2967:7434:51bb:e234]) by MW4PR21MB1857.namprd21.prod.outlook.com ([fe80::2967:7434:51bb:e234%4]) with mapi id 15.20.3433.012; Wed, 23 Sep 2020 06:12:12 +0000 From: "Bret Barkelew" To: Bret Barkelew , "devel@edk2.groups.io" CC: "Yao, Jiewen" , Dandan Bi , Chao Zhang , Jian J Wang , Hao A Wu , liming.gao , Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Andrew Fish , "Ni, Ray" Subject: Re: [EXTERNAL] [PATCH v8 00/14] Add the VariablePolicy feature Thread-Topic: [EXTERNAL] [PATCH v8 00/14] Add the VariablePolicy feature Thread-Index: AQHWkW/tFw56LQrGvkiPg9GncpIQ7ql1veqy Date: Wed, 23 Sep 2020 06:12:12 +0000 Message-ID: References: <20200923060748.3795-1-bret.barkelew@microsoft.com> In-Reply-To: <20200923060748.3795-1-bret.barkelew@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-09-23T06:11:36.8580163Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: corthon.com; dkim=none (message not signed) header.d=none;corthon.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [174.21.140.128] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 24a3f795-c521-4759-6291-08d85f879cc1 x-ms-traffictypediagnostic: MW2PR2101MB1115: x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nIAGgfoZGYZkvfViyjSYMuszf3QQPOf6VtscthX7Agvb8+dV7RvZM6SI4aJuXHgAArbOUhnQrxJ6lL0VGIm8FITVkPpGLE365nRYrch54MFGgTawanxMRoNoeO+icO4p3cbqy2di0/8u+D9GZrSXJOLd+Kn5podydqpnVFsZlosky4XzXqAK3TCGb7toDENSgrRm4nTzMcKSNVfYleH1Q2lzdaGK4dYpwSOD/BEzCw+WNgyz75rYOkmsCFZ1tLBld4ib835KWD/brjXKT6ZBM7dzD7nn+YBobn76IAoGD3PcfBUsXk2TxAcXsFjDMVkg4IemBWF3IIW70HZ66rPg189JCG501w003zN/e66s5SN1TC1z5ZPA2ZDrInB/+WqW4zawj+LxamPQ7fXYZ9ixqg2qqh7mo/gvoi5HGY1A/HBqicFCp2g6Oh+etxe6MKbt4p3vEd+EMS+CxLw3doSXSA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR21MB1857.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(82960400001)(82950400001)(30864003)(186003)(26005)(110136005)(7696005)(52536014)(316002)(10290500003)(166002)(83380400001)(54906003)(4326008)(7416002)(33656002)(76116006)(53546011)(6506007)(66556008)(71200400001)(2906002)(478600001)(9686003)(8676002)(55016002)(8990500004)(8936002)(64756008)(66476007)(86362001)(5660300002)(966005)(66946007)(66446008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 32Tyhrq+aaPoTZE97CoGe+xvvZ8q/7dwXLDD3IrrmDjF0raxxcijg6LCFzmYBuFI9Tsnmrb0uG5migo/UXTG8FWP216qcZDurcXVXN7qvY+4twB6cpg3tXi14a0qaZszwqOQVmnf5VqC/cI8edncz5Am5HtAAgRssPqR8DK6NbhlOHnkMr9S3ySJoAAHTY5gumRQ9/RIFUAjnpq/61FBSFfBZPBZmlfm8pOGrvOehi6WDA02IYczoX/sCDr+5AEYVv5UmxFS4+a/EAEaCy5AZ6clQAcB4jPoVks+qdAWLbJhSaryHt79Zp0m6AROJGL0S2i8N8f2Yf0F560dmYhE47mldYSYqlcBfcVKNfPjcaq7uXh5XKo4v4fujMVk0liMwf618D1NXJp+JUjO8AA8s/NjQuMNZH6VoBL6mL47UEEOUJkLb1FPjDm5lZOBlB6BLwDhInIrzDD0Zm8yOvqVEak+RTssFe6+7yimnN/fXDiTkhOU4NAXoff1Zjec0L2yFtcDrA5b2IX8QmACINwA+eA92NXwQzlpLWUwlzPNa8zet/4XJfS/VxOyNo3s6tKXCr7A+AmyNzQWE+dlg5YrYibYMl470uXsGWzSOiRJ1SYHlkebRpnsPnG79dK0HEWzTeOEvSUnQKq1Sp6UpU6sAw== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR21MB1857.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24a3f795-c521-4759-6291-08d85f879cc1 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Sep 2020 06:12:12.6365 (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: XYP64USf88dJN/6YUvUrCz20BahIZ/BOBEboBakRAjQGyn5OvSrjYABvH3LyrBqSORshVyH+RqjTt1EBG2oK+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1115 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW4PR21MB185772C2C3D082C3EEEDEE45EF380MW4PR21MB1857namp_" --_000_MW4PR21MB185772C2C3D082C3EEEDEE45EF380MW4PR21MB1857namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable To whom it may concern, This is as done as it=92s going to get. Thank you all for your help! - Bret From: Bret Barkelew Sent: Tuesday, September 22, 2020 11:08 PM To: devel@edk2.groups.io Cc: Yao, Jiewen; Dandan Bi; Chao Zhang; Jian J Wang; Hao A Wu; liming.gao; Jordan Justen; La= szlo Ersek; Ard Biesheuvel; Andrew Fish; Ni, Ray; Bret Barkelew Subject: [EXTERNAL] [PATCH v8 00/14] Add the VariablePolicy feature 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 libraries= , 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---En= hanced-Method-for-Managing-Variables%23platform-porting&data=3D02%7C01%= 7CBret.Barkelew%40microsoft.com%7C1b508888579a496271ae08d85f870cf2%7C72f988= bf86f141af91ab2d7cd011db47%7C1%7C0%7C637364380959491498&sdata=3Dn2SYXG8= iUBvDc2bo0%2B%2BB9Ftut46VNtVgdpJSFnX6%2Fu4%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.gr= oups.io%2Fg%2Fdevel%2Fmessage%2F53712&data=3D02%7C01%7CBret.Barkelew%40= microsoft.com%7C1b508888579a496271ae08d85f870cf2%7C72f988bf86f141af91ab2d7c= d011db47%7C1%7C0%7C637364380959491498&sdata=3D81ta2Tht%2FwjDjk8LqQ8wRI0= I1ggK14fePhWlMxDOCGA%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: Dandan Bi 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 v8 changes: * Rebase * Small tweaks from final PRs * Drank a lot * Enrolled several members and a steward in CatFacts v7 changes: * Address comments from Dandan about security of the MM handler * Add readme * Fix bug around hex characters in BOOT####, etc * Add additional testing for hex characters * Add additional testing for authenticated variables v6 changes: * Fix an issue with uninitialized Status in InitVariablePolicyLib() and Dei= nitVariablePolicyLib() * 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 platfor= ms * 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 variable= s 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 gVariablePolicyProtocolGui= d 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 = | 345 +++ MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.c = | 396 ++++ MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitNull.c = | 46 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitRuntimeDxe.c= | 85 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c = | 830 +++++++ MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePoli= cyUnitTest.c | 2452 ++++++++++++++++++++ MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyFuncTe= stApp.c | 2226 ++++++++++++++++++ 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 = | 56 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.c = | 71 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c = | 642 +++++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c = | 14 + SecurityPkg/Library/AuthVariableLib/AuthService.c = | 30 +- 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/ReadMe.md = | 410 ++++ MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf = | 49 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.uni = | 12 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf = | 51 + MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/VariablePoli= cyUnitTest.inf | 45 + MdeModulePkg/MdeModulePkg.ci.yaml = | 8 +- MdeModulePkg/MdeModulePkg.dec = | 26 +- MdeModulePkg/MdeModulePkg.dsc = | 9 + MdeModulePkg/MdeModulePkg.uni = | 7 + MdeModulePkg/Test/MdeModulePkgHostTest.dsc = | 11 + MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/Readme.md = | 55 + MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyFuncTe= stApp.inf | 47 + MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyTestAu= thVar.h | 128 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf = | 5 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf = | 4 + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf = | 11 + 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 + 49 files changed, 8874 insertions(+), 81 deletions(-) create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLi= b.c create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePo= licyHelperLib.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyEx= traInitNull.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyEx= traInitRuntimeDxe.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLi= b.c create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUn= itTest/VariablePolicyUnitTest.c create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/V= ariablePolicyFuncTestApp.c create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLock= RequestToLock.c create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePoli= cySmmDxe.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/VarCheckPolicyLi= b.inf create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLi= b.uni create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePo= licyHelperLib.inf create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePo= licyHelperLib.uni create mode 100644 MdeModulePkg/Library/VariablePolicyLib/ReadMe.md create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLi= b.inf create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLi= b.uni create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLi= bRuntimeDxe.inf create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUn= itTest/VariablePolicyUnitTest.inf create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/R= eadme.md create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/V= ariablePolicyFuncTestApp.inf create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/V= ariablePolicyTestAuthVar.h -- 2.28.0.windows.1 --_000_MW4PR21MB185772C2C3D082C3EEEDEE45EF380MW4PR21MB1857namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

To whom it may concern,

This is as done as it=92s going to get.

 

Thank you all for your help!

 

- Bret

 

From: Bret Barkelew
Sent: Tuesday, September 22, 2020 11:08 PM
To: devel@edk2.groups.io=
Cc: Yao, Jiewen; Dandan Bi; Chao Zhang; Jian J Wang; Hao A Wu; liming.gao; Jordan Justen<= /a>; Laszlo Ersek; Ard Biesheuvel<= /a>; Andrew Fish; Ni, Ray; Bret Barkelew
Subject: [EXTERNAL] [PATCH v8 00/14] Add the VariablePolicy feature<= /p>

 

The 14 patches in thi= s 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 libraries= ,
a protocol, an SMI communication handler, and VariableServices integration,=
the patches are broken up by individual library additions and then a final<= br> 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-P= rotocol---Enhanced-Method-for-Managing-Variables%23platform-porting&amp= ;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C1b508888579a496271ae08d85= f870cf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637364380959491498&= ;amp;sdata=3Dn2SYXG8iUBvDc2bo0%2B%2BB9Ftut46VNtVgdpJSFnX6%2Fu4%3D&amp;r= eserved=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://na= m06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk2.groups.io%2F= g%2Fdevel%2Fmessage%2F53712&amp;data=3D02%7C01%7CBret.Barkelew%40micros= oft.com%7C1b508888579a496271ae08d85f870cf2%7C72f988bf86f141af91ab2d7cd011db= 47%7C1%7C0%7C637364380959491498&amp;sdata=3D81ta2Tht%2FwjDjk8LqQ8wRI0I1= ggK14fePhWlMxDOCGA%3D&amp;reserved=3D0
(the code branches shared in that discussion are now out of date, but the whitepapers and discussion are relevant).

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Dandan Bi <dandan.bi@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>

v8 changes:
* Rebase
* Small tweaks from final PRs
* Drank a lot
* Enrolled several members and a steward in CatFacts

v7 changes:
* Address comments from Dandan about security of the MM handler
* Add readme
* Fix bug around hex characters in BOOT####, etc
* Add additional testing for hex characters
* Add additional testing for authenticated variables

v6 changes:
* Fix an issue with uninitialized Status in InitVariablePolicyLib() and Dei= nitVariablePolicyLib()
* 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 platfor= ms
* 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 variable= s

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 gVariablePolicyProtocolGui= d
  to EDKII_VARIABLE_POLICY_PROTOCOL and gEdkiiVariablePolicyProtocolGu= id
* 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<= br>   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 variabl= es
  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  = ;            &n= bsp;            = ;    |  345 +++
 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.= c            &n= bsp;      |  396 ++++
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitNull.c&= nbsp;           &nbs= p;        |   46 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyExtraInitRuntime= Dxe.c           &nbs= p;   |   85 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c  = ;            &n= bsp;            = ;    |  830 +++++++
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/Variabl= ePolicyUnitTest.c   | 2452 ++++++++++++++++++++
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyF= uncTestApp.c        | 2226 +++++++++++++= +++++
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockDxe.c  = ;            &n= bsp;            = ;    |   52 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c  = ;            &n= bsp;            = ;    |   60 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VarCheck.c  &nbs= p;            &= nbsp;           &nbs= p;        |   49 +-
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c  &= nbsp;           &nbs= p;            &= nbsp;     |   56 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableLockRequestToLock.= c            &n= bsp;      |   71 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariablePolicySmmDxe.c&nbs= p;            &= nbsp;          |  642 +++= ++
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c&nb= sp;            =           |   14 +  SecurityPkg/Library/AuthVariableLib/AuthService.c   &n= bsp;            = ;            &n= bsp;           | &nb= sp; 30 +-
 ArmVirtPkg/ArmVirt.dsc.inc       &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;     |    4 +
 EmulatorPkg/EmulatorPkg.dsc       =             &nb= sp;            =             &nb= sp;            =      |    3 +
 MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h    =             &nb= sp;            =             &nb= sp;  |   54 +
 MdeModulePkg/Include/Library/VariablePolicyHelperLib.h  &nb= sp;            =             &nb= sp;       |  164 ++
 MdeModulePkg/Include/Library/VariablePolicyLib.h   &nb= sp;            =             &nb= sp;            |&nbs= p; 207 ++
 MdeModulePkg/Include/Protocol/VariablePolicy.h    = ;            &n= bsp;            = ;            &n= bsp; |  157 ++
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.inf &nb= sp;            =             &nb= sp;  |   42 +
 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPolicyLib.uni &nb= sp;            =             &nb= sp;  |   12 +
 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.= inf            =      |   35 +
 MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.= uni            =      |   12 +
 MdeModulePkg/Library/VariablePolicyLib/ReadMe.md   &nb= sp;            =             &nb= sp;            |&nbs= p; 410 ++++
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf &nb= sp;            =             &nb= sp;  |   49 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.uni &nb= sp;            =             &nb= sp;  |   12 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.in= f            &n= bsp;      |   51 +
 MdeModulePkg/Library/VariablePolicyLib/VariablePolicyUnitTest/Variabl= ePolicyUnitTest.inf |   45 +
 MdeModulePkg/MdeModulePkg.ci.yaml      =             &nb= sp;            =             &nb= sp;            |&nbs= p;   8 +-
 MdeModulePkg/MdeModulePkg.dec      &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;   |   26 +-
 MdeModulePkg/MdeModulePkg.dsc      &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;   |    9 +
 MdeModulePkg/MdeModulePkg.uni      &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;   |    7 +
 MdeModulePkg/Test/MdeModulePkgHostTest.dsc    &nb= sp;            =             &nb= sp;            =      |   11 +
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/Readme.md =             &nb= sp;            |&nbs= p;  55 +
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyF= uncTestApp.inf      |   47 +
 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTestApp/VariablePolicyT= estAuthVar.h        |  128 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf&nbs= p;            &= nbsp;          |  &n= bsp; 5 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf  = ;            &n= bsp;            = ;    |    4 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf&= nbsp;           &nbs= p;        |   11 +
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf&n= bsp;            = ;         |    4 +  OvmfPkg/OvmfPkgIa32.dsc       &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;        |    5 +
 OvmfPkg/OvmfPkgIa32X64.dsc       &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;     |    5 +
 OvmfPkg/OvmfPkgX64.dsc        = ;            &n= bsp;            = ;            &n= bsp;            = ;         |    5 +  OvmfPkg/OvmfXen.dsc        &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;           | &nb= sp;  4 +
 SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf  &n= bsp;            = ;            &n= bsp;      |    2 +
 UefiPayloadPkg/UefiPayloadPkgIa32.dsc     &n= bsp;            = ;            &n= bsp;            = ;         |    4 +  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc     = ;            &n= bsp;            = ;            &n= bsp;      |    4 +
 49 files changed, 8874 insertions(+), 81 deletions(-)
 create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPol= icyLib.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/Varia= blePolicyHelperLib.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyExtraInitNull.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyExtraInitRuntimeDxe.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyLib.c
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyUnitTest/VariablePolicyUnitTest.c
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTest= App/VariablePolicyFuncTestApp.c
 create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/Variabl= eLockRequestToLock.c
 create mode 100644 MdeModulePkg/Universal/Variable/RuntimeDxe/Variabl= ePolicySmmDxe.c
 create mode 100644 MdeModulePkg/Include/Guid/VarCheckPolicyMmi.h
 create mode 100644 MdeModulePkg/Include/Library/VariablePolicyHelperL= ib.h
 create mode 100644 MdeModulePkg/Include/Library/VariablePolicyLib.h  create mode 100644 MdeModulePkg/Include/Protocol/VariablePolicy.h
 create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPol= icyLib.inf
 create mode 100644 MdeModulePkg/Library/VarCheckPolicyLib/VarCheckPol= icyLib.uni
 create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/Varia= blePolicyHelperLib.inf
 create mode 100644 MdeModulePkg/Library/VariablePolicyHelperLib/Varia= blePolicyHelperLib.uni
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/ReadMe.md  create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyLib.inf
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyLib.uni
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyLibRuntimeDxe.inf
 create mode 100644 MdeModulePkg/Library/VariablePolicyLib/VariablePol= icyUnitTest/VariablePolicyUnitTest.inf
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTest= App/Readme.md
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTest= App/VariablePolicyFuncTestApp.inf
 create mode 100644 MdeModulePkg/Test/ShellTest/VariablePolicyFuncTest= App/VariablePolicyTestAuthVar.h

--
2.28.0.windows.1

 

--_000_MW4PR21MB185772C2C3D082C3EEEDEE45EF380MW4PR21MB1857namp_--