Revision: 16989
          http://sourceforge.net/p/edk2/code/16989
Author:   hwu1225
Date:     2015-03-03 05:03:00 +0000 (Tue, 03 Mar 2015)
Log Message:
-----------
Add failed image Name in the Image Execution Information Table.

(Sync patch r16493 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Dong Guo <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Zhang Chao B <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/16493

Modified Paths:
--------------
    
branches/UDK2014.SP1/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c

Modified: 
branches/UDK2014.SP1/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
===================================================================
--- 
branches/UDK2014.SP1/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
  2015-03-03 03:25:06 UTC (rev 16988)
+++ 
branches/UDK2014.SP1/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
  2015-03-03 05:03:00 UTC (rev 16989)
@@ -754,7 +754,7 @@
   }
 
   DevicePathSize            = GetDevicePathSize (DevicePath);
-  NewImageExeInfoEntrySize  = sizeof (EFI_IMAGE_EXECUTION_INFO) + 
NameStringLen + DevicePathSize + SignatureSize;
+  NewImageExeInfoEntrySize  = sizeof (EFI_IMAGE_EXECUTION_INFO) - sizeof 
(EFI_SIGNATURE_LIST) + NameStringLen + DevicePathSize + SignatureSize;
   NewImageExeInfoTable      = (EFI_IMAGE_EXECUTION_INFO_TABLE *) 
AllocateRuntimePool (ImageExeInfoTableSize + NewImageExeInfoEntrySize);
   if (NewImageExeInfoTable == NULL) {
     return ;
@@ -1063,6 +1063,7 @@
   UINTN                                AuthDataSize;
   EFI_IMAGE_DATA_DIRECTORY             *SecDataDir;
   UINT32                               OffSet;
+  CHAR16                               *NameStr;
 
   SignatureList     = NULL;
   SignatureListSize = 0;
@@ -1366,7 +1367,12 @@
     //
     // Policy decides to defer or reject the image; add its information in 
image executable information table.
     //
-    AddImageExeInfo (Action, NULL, File, SignatureList, SignatureListSize);
+    NameStr = ConvertDevicePathToText (File, FALSE, TRUE);
+    AddImageExeInfo (Action, NameStr, File, SignatureList, SignatureListSize);
+    if (NameStr != NULL) {
+      DEBUG((EFI_D_INFO, "The image doesn't pass verification: %s\n", 
NameStr));
+      FreePool(NameStr);
+    }
     Status = EFI_SECURITY_VIOLATION;
   }
 


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to