[edk2-devel] Recent changes to EsrtFmp causing ASSERTs

jason.spottswood at hpe.com jason.spottswood at hpe.com
Mon Sep 30 20:48:16 UTC 2019


In EsrtFmp.c, function CreateEsrtEntry, line 196, the code asserts if the FMP image hardware instance matches that of an existing instance.  This is fine if the hardware instance is supported.  The field is optional though.  In the UEFI spec, "a zero hardware instance means the FMP provider is not able to determine a unique hardware instance number or a hardware instance number is not needed."  The code below needs to also check if the hardware instance is supported (by comparing it to zero) before checking it against existing entries.

 //
 // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique
 //
 for (Index = 0; Index < *NumberOfDescriptors; Index++) {
   if ( CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId)) {
     if (HardwareInstances[Index].HardwareInstance == FmpHardwareInstance) {
       DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image descriptor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf->ImageTypeId, FmpHardwareInstance));
       ASSERT (
         ! CompareGuid (&HardwareInstances[Index].ImageTypeGuid, &FmpImageInfoBuf->ImageTypeId) ||
         HardwareInstances[Index].HardwareInstance != FmpHardwareInstance
         );
       return EFI_UNSUPPORTED;
     }
   }
 }

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

View/Reply Online (#48306): https://edk2.groups.io/g/devel/message/48306
Mute This Topic: https://groups.io/mt/34350126/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20190930/2204714a/attachment.htm>


More information about the edk2-devel-archive mailing list