From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: chao.b.zhang@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Mon, 13 May 2019 07:09:54 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 May 2019 07:09:53 -0700 X-ExtLoop1: 1 Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 13 May 2019 07:09:53 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 13 May 2019 07:09:52 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.249]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.129]) with mapi id 14.03.0415.000; Mon, 13 May 2019 22:09:51 +0800 From: "Zhang, Chao B" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Wang, Jian J" , "Zeng, Star" , "Gao, Liming" Subject: Re: [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb Thread-Topic: [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in certdb Thread-Index: AQHVCTdhefPVTMqLIE+y6tsnJTtniKZpGGaQ Date: Mon, 13 May 2019 14:09:50 +0000 Message-ID: References: <20190513025517.23236-1-zhichao.gao@intel.com> In-Reply-To: <20190513025517.23236-1-zhichao.gao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzU1MDhlY2UtOTc1ZC00YjhjLWIwY2MtYTk0YjkzZTY5YjkxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZERFcXhBME9wN1lxYnRGVFNUUGpZbHpWK1RualJ1Q05BTlMraE5PdVhcL0t5MnB0dTZORjdmMEJjN3N1RXVIVDkifQ== dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: chao.b.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by : Chao Zhang -----Original Message----- From: Gao, Zhichao=20 Sent: Monday, May 13, 2019 10:55 AM To: devel@edk2.groups.io Cc: Zhang, Chao B ; Yao, Jiewen ; Wang, Jian J ; Zeng, Star = ; Gao, Liming Subject: [PATCH] SecurityPkg/AuthSeriableLib: Always delete variable in cer= tdb REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1783 While cleaning the certdb, always delete the variable data in the certdb re= gardless of its attribute. Cc: Chao Zhang Cc: Jiewen Yao Cc: Jian Wang Cc: Star Zeng Cc: Liming Gao Signed-off-by: Zhichao Gao --- SecurityPkg/Library/AuthVariableLib/AuthService.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPk= g/Library/AuthVariableLib/AuthService.c index 7493a2ed9c..2340d47e77 100644 --- a/SecurityPkg/Library/AuthVariableLib/AuthService.c +++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c @@ -1735,10 +1735,13 @@ CleanCertsFromDb ( ); =20 if (EFI_ERROR(Status) || (AuthVariableInfo.Attributes & EFI_VARIABLE= _TIME_BASED_AUTHENTICATED_WRITE_ACCESS) =3D=3D 0) { + // + // While cleaning certdb, always delete the variable in certdb reg= ardless of it attributes. + // Status =3D DeleteCertsFromDb( VariableName, &AuthVarGuid, - AuthVariableInfo.Attributes + AuthVariableInfo.Attributes |=20 + EFI_VARIABLE_NON_VOLATILE ); CertCleaned =3D TRUE; DEBUG((EFI_D_INFO, "Recovery!! Cert for Auth Variable %s Guid %g i= s removed for consistency\n", VariableName, &AuthVarGuid)); -- 2.21.0.windows.1