]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Tcg/TrEESmm/TrEESmm.c
Fix the return status when physical presence variable and MemoryOverwriteRequestContr...
[mirror_edk2.git] / SecurityPkg / Tcg / TrEESmm / TrEESmm.c
index 4826b7916dca3a41a4cf3335c67da7b4fe09dcc9..14303d5458da44035bfb3e245fd6b668751f7015 100644 (file)
@@ -9,7 +9,7 @@
 \r
   PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.\r
 \r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -84,6 +84,8 @@ PhysicalPresenceCallback (
                            &PpData\r
                            );\r
   if (EFI_ERROR (Status)) {\r
+    mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+    DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status));\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -116,6 +118,7 @@ PhysicalPresenceCallback (
 \r
     if (EFI_ERROR (Status)) { \r
       mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+      DEBUG ((EFI_D_ERROR, "[TPM] Set PP variable failure! Status = %r\n", Status));\r
       return EFI_SUCCESS;\r
     }\r
     mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_SUCCESS;\r
@@ -133,6 +136,7 @@ PhysicalPresenceCallback (
                              );\r
     if (EFI_ERROR (Status)) {\r
       mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+      DEBUG ((EFI_D_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status));\r
       return EFI_SUCCESS;\r
     }\r
 \r
@@ -220,6 +224,8 @@ MemoryClearCallback (
                              &MorControl\r
                              );\r
     if (EFI_ERROR (Status)) {\r
+      mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;\r
+      DEBUG ((EFI_D_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status));\r
       return EFI_SUCCESS;\r
     }\r
 \r
@@ -239,6 +245,7 @@ MemoryClearCallback (
                            );\r
   if (EFI_ERROR (Status)) { \r
     mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;\r
+    DEBUG ((EFI_D_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status));\r
   }\r
 \r
   return EFI_SUCCESS;\r