public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Recent changes to EsrtFmp causing ASSERTs
@ 2019-09-30 20:48 jason.spottswood
  2019-09-30 20:52 ` [edk2-devel] " Rothman, Michael A
  0 siblings, 1 reply; 11+ messages in thread
From: jason.spottswood @ 2019-09-30 20:48 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]

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;
     }
   }
 }

[-- Attachment #2: Type: text/html, Size: 1683 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-10-21 16:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-30 20:48 Recent changes to EsrtFmp causing ASSERTs jason.spottswood
2019-09-30 20:52 ` [edk2-devel] " Rothman, Michael A
2019-09-30 21:23   ` jason.spottswood
2019-10-01 16:49     ` Sean
2019-10-01 17:30     ` Michael D Kinney
2019-10-01 21:20       ` Spottswood, Jason
2019-10-02 15:12         ` Michael D Kinney
2019-10-18 21:52           ` scott.wiginton
2019-10-19  1:03             ` Michael D Kinney
2019-10-21 13:12               ` scott.wiginton
2019-10-21 16:30                 ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox