aboutsummaryrefslogtreecommitdiff
path: root/lib/smbios-parser.c
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2024-01-26 09:53:42 +0900
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-01-26 14:16:17 +0100
commit2497f6a84c0b906551d08054a631b86942cb4fa9 (patch)
treea63258e146c46efca9daed3d1257fa4e2d702420 /lib/smbios-parser.c
parentd4f721bc141354fb2f8fc7bf407ef63399e8e155 (diff)
efi_loader: migrate SMBIOS 3.0 entry point structure for measurement
Current U-Boot only supports the SMBIOS 3.0 entry point structure. TCG2 measurement code should migrate to SMBIOS 3.0 entry point structure. efi_selftest tcg2 test also needs to be updated, and expected PCR[1] result is changed since guid for SMBIOS EFI system table uses different guid SMBIOS3_TABLE_GUID instead of SMBIOS_TABLE_GUID. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/smbios-parser.c')
-rw-r--r--lib/smbios-parser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/smbios-parser.c b/lib/smbios-parser.c
index ac9a367a87..f48d743657 100644
--- a/lib/smbios-parser.c
+++ b/lib/smbios-parser.c
@@ -223,21 +223,24 @@ static void clear_smbios_table(struct smbios_header *header,
}
}
-void smbios_prepare_measurement(const struct smbios_entry *entry,
+void smbios_prepare_measurement(const struct smbios3_entry *entry,
struct smbios_header *smbios_copy)
{
u32 i, j;
+ void *table_end;
struct smbios_header *header;
+ table_end = (void *)((u8 *)smbios_copy + entry->max_struct_size);
+
for (i = 0; i < ARRAY_SIZE(smbios_filter_tables); i++) {
header = smbios_copy;
- for (j = 0; j < entry->struct_count; j++) {
+ for (j = 0; (void *)header < table_end; j++) {
if (header->type == smbios_filter_tables[i].type)
break;
header = get_next_header(header);
}
- if (j >= entry->struct_count)
+ if ((void *)header >= table_end)
continue;
clear_smbios_table(header,