REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2443

Refer to Physical Presence Interface Spec Page 37, the firmware
may perform the PLATFORM RESET imediately after the
TPM_PhysicalSetDeactivated = TRUE but that requires tracking
the next command.
Change the operation to match the spec.

Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Jian J Wang <jian.j.w...@intel.com>
Cc: Chao Zhang <chao.b.zh...@intel.com>
Signed-off-by: Zhichao Gao <zhichao....@intel.com>
---
 .../DxeTcgPhysicalPresenceLib.c                       | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c 
b/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c
index 7fb2ef9735..de339c9703 100644
--- a/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c
+++ b/SecurityPkg/Library/DxeTcgPhysicalPresenceLib/DxeTcgPhysicalPresenceLib.c
@@ -346,9 +346,16 @@ ExecutePhysicalPresence (
       return TpmResponse;
 
     case PHYSICAL_PRESENCE_DEACTIVATE_DISABLE_OWNER_FALSE:
-      TpmResponse = ExecutePhysicalPresence (TcgProtocol, 
PHYSICAL_PRESENCE_SET_OWNER_INSTALL_FALSE, PpiFlags);
-      if (TpmResponse == 0) {
+      //
+      // PHYSICAL_PRESENCE_SET_OWNER_INSTALL_FALSE + 
PHYSICAL_PRESENCE_DEACTIVATE_DISABLE
+      // PHYSICAL_PRESENCE_DEACTIVATE_DISABLE will be executed after reboot
+      //
+      if ((PpiFlags->PPFlags & TCG_VENDOR_LIB_FLAG_RESET_TRACK) == 0) {
+        TpmResponse = ExecutePhysicalPresence (TcgProtocol, 
PHYSICAL_PRESENCE_SET_OWNER_INSTALL_FALSE, PpiFlags);
+        PpiFlags->PPFlags |= TCG_VENDOR_LIB_FLAG_RESET_TRACK;
+      } else {
         TpmResponse = ExecutePhysicalPresence (TcgProtocol, 
PHYSICAL_PRESENCE_DEACTIVATE_DISABLE, PpiFlags);
+        PpiFlags->PPFlags &= ~TCG_VENDOR_LIB_FLAG_RESET_TRACK;
       }
       return TpmResponse;
 
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52720): https://edk2.groups.io/g/devel/message/52720
Mute This Topic: https://groups.io/mt/69392343/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to