From 3c394a67756f4c98515c57a3ff83e8d5f139904c Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 29 Oct 2015 01:10:18 +0000 Subject: MdeModulePkg SmbiosMeasurementDxe: Use SMBIOS table and GUID correctly 1. Smbios3Table used as SmbiosTable wrongly after SmbiosTable got from configuration table. 2. Use correct VendorGuid and VendorTable to measure. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18691 6f19259b-4bc3-4df7-8a09-765794883524 --- .../SmbiosMeasurementDxe/SmbiosMeasurementDxe.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c index 21528276c1..85963818dc 100644 --- a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c +++ b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c @@ -478,6 +478,8 @@ MeasureSmbiosTable ( DEBUG ((EFI_D_INFO, " TableAddress - 0x%016lx\n", Smbios3Table->TableAddress)); } } + + if (Smbios3Table == NULL) { Status = EfiGetSystemConfigurationTable ( &gEfiSmbiosTableGuid, (VOID **) &SmbiosTable @@ -485,10 +487,10 @@ MeasureSmbiosTable ( if (!EFI_ERROR (Status)) { DEBUG ((EFI_D_INFO, "SmbiosTable:\n")); DEBUG ((EFI_D_INFO, " AnchorString - '%c%c%c%c'\n", - Smbios3Table->AnchorString[0], - Smbios3Table->AnchorString[1], - Smbios3Table->AnchorString[2], - Smbios3Table->AnchorString[3] + SmbiosTable->AnchorString[0], + SmbiosTable->AnchorString[1], + SmbiosTable->AnchorString[2], + SmbiosTable->AnchorString[3] )); DEBUG ((EFI_D_INFO, " EntryPointStructureChecksum - 0x%02x\n", SmbiosTable->EntryPointStructureChecksum)); DEBUG ((EFI_D_INFO, " EntryPointLength - 0x%02x\n", SmbiosTable->EntryPointLength)); @@ -516,6 +518,7 @@ MeasureSmbiosTable ( DEBUG ((EFI_D_INFO, " NumberOfSmbiosStructures - 0x%04x\n", SmbiosTable->NumberOfSmbiosStructures)); DEBUG ((EFI_D_INFO, " SmbiosBcdRevision - 0x%02x\n", SmbiosTable->SmbiosBcdRevision)); } + } if (Smbios3Table != NULL) { SmbiosTableAddress = (VOID *)(UINTN)Smbios3Table->TableAddress; @@ -542,8 +545,13 @@ MeasureSmbiosTable ( InternalDumpHex (TableAddress, TableLength); HandoffTables.NumberOfTables = 1; - HandoffTables.TableEntry[0].VendorGuid = gEfiSmbiosTableGuid; - HandoffTables.TableEntry[0].VendorTable = SmbiosTable; + if (Smbios3Table != NULL) { + CopyGuid (&(HandoffTables.TableEntry[0].VendorGuid), &gEfiSmbios3TableGuid); + HandoffTables.TableEntry[0].VendorTable = Smbios3Table; + } else { + CopyGuid (&(HandoffTables.TableEntry[0].VendorGuid), &gEfiSmbiosTableGuid); + HandoffTables.TableEntry[0].VendorTable = SmbiosTable; + } Status = TpmMeasureAndLogData ( 1, // PCRIndex EV_EFI_HANDOFF_TABLES, // EventType -- cgit v1.2.3