From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id 3EF941A1E11 for ; Mon, 15 Aug 2016 22:06:11 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 15 Aug 2016 22:06:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,528,1464678000"; d="scan'208";a="866068183" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 15 Aug 2016 22:06:10 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Aug 2016 22:06:10 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.150]) with mapi id 14.03.0248.002; Tue, 16 Aug 2016 13:06:07 +0800 From: "Zeng, Star" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , "Zhang, Chao B" Thread-Topic: [edk2] [PATCH V1] SecurityPkg: AuthVariableLib: Fix potential inconsistency corner case for Time Auth variable Thread-Index: AQHR92deP7y2SF/c7kOUdUhiJzVqn6BLCOJw Date: Tue, 16 Aug 2016 05:06:07 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB048310036A4518@shsmsx102.ccr.corp.intel.com> References: <1471315139-19308-1-git-send-email-chao.b.zhang@intel.com> In-Reply-To: <1471315139-19308-1-git-send-email-chao.b.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V1] SecurityPkg: AuthVariableLib: Fix potential inconsistency corner case for Time Auth variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2016 05:06:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhan= g, Chao B Sent: Tuesday, August 16, 2016 10:39 AM To: edk2-devel@lists.01.org Cc: Fu, Siyuan ; Zhang, Chao B ; Zeng, Star Subject: [edk2] [PATCH V1] SecurityPkg: AuthVariableLib: Fix potential inco= nsistency corner case for Time Auth variable 2 steps are used to create/delete a time based variable. For create, step= 1: Insert Signer Cert to CertDB. Step 2: Insert Payload to Variable. For d= elete, step 1: Delete Variable. Step 2: Delete Cert from CertDB. System may= breaks between step 1 & step 2, so CertDB may contains useless Cert in the= next reboot. AuthVariableLib choose to sync consistent state between CertD= B & Time Auth Variable on initialization. However, it doesn't apply Time Au= th attribute check. Now add it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang --- SecurityPkg/Library/AuthVariableLib/AuthService.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SecurityPkg/Library/AuthVariableLib/AuthService.c b/SecurityPk= g/Library/AuthVariableLib/AuthService.c index 6e1e284..b013d42 100644 --- a/SecurityPkg/Library/AuthVariableLib/AuthService.c +++ b/SecurityPkg/Library/AuthVariableLib/AuthService.c @@ -2100,7 +2100,7 @@ CleanCertsFromDb ( &AuthVariableInfo ); =20 - if (EFI_ERROR(Status)) { + if (EFI_ERROR(Status) || (AuthVariableInfo.Attributes & EFI_VARIABLE= _TIME_BASED_AUTHENTICATED_WRITE_ACCESS) =3D=3D 0) { Status =3D DeleteCertsFromDb( VariableName, &AuthVarGuid, --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel