From: Jiewen Yao Date: Thu, 10 Mar 2016 05:44:40 +0000 (-0800) Subject: SecurityPkg: Fix Tcg2 SubmitRequestToPreOSFunction() fail in second times. X-Git-Tag: edk2-stable201903~7644 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=6d7c4a25b7b019cc2080d5cf1a6fd11347465d65;hp=3a0f8bdef348a3afca72217d319bb1a8d8b1036a SecurityPkg: Fix Tcg2 SubmitRequestToPreOSFunction() fail in second times. Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction() has check if current request is same as previous. But it forget check RequestParameter, which causes second request fail to process, if RequestParameter is different. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" Reviewed-by: "Zhang, Chao B" --- diff --git a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c index 46fc616d5e..8912ee4108 100644 --- a/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c +++ b/SecurityPkg/Library/DxeTcg2PhysicalPresenceLib/DxeTcg2PhysicalPresenceLib.c @@ -7,7 +7,7 @@ Tpm2ExecutePendingTpmRequest() will receive untrusted input and do validation. -Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1208,7 +1208,8 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction ( return TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED; } - if (PpData.PPRequest != OperationRequest) { + if ((PpData.PPRequest != OperationRequest) || + (PpData.PPRequestParameter != RequestParameter)) { PpData.PPRequest = (UINT8)OperationRequest; PpData.PPRequestParameter = RequestParameter; DataSize = sizeof (EFI_TCG2_PHYSICAL_PRESENCE); diff --git a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c index 360df720de..081ec6c00c 100644 --- a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c +++ b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c @@ -10,7 +10,7 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction() and Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction() will receive untrusted input and do validation. -Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -134,7 +134,8 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction ( return TCG_PP_SUBMIT_REQUEST_TO_PREOS_NOT_IMPLEMENTED; } - if (PpData.PPRequest != OperationRequest) { + if ((PpData.PPRequest != OperationRequest) || + (PpData.PPRequestParameter != RequestParameter)) { PpData.PPRequest = (UINT8)OperationRequest; PpData.PPRequestParameter = RequestParameter; DataSize = sizeof (EFI_TCG2_PHYSICAL_PRESENCE);