From 73b2b5037234716d69cabadb13bcf919aff68059 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 1 May 2004 04:08:14 +0000 Subject: [PATCH] Verify the MADT checksum before using the table. Submitted by: njl --- sys/ia64/acpica/madt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/ia64/acpica/madt.c b/sys/ia64/acpica/madt.c index b82db3e74218..ad1205e0f6eb 100644 --- a/sys/ia64/acpica/madt.c +++ b/sys/ia64/acpica/madt.c @@ -27,6 +27,7 @@ */ #include "acpi.h" +#include #include @@ -136,7 +137,8 @@ ia64_probe_sapics(void) table->Signature[0], table->Signature[1], table->Signature[2], table->Signature[3], table); - if (strncmp(table->Signature, APIC_SIG, 4) != 0) + if (strncmp(table->Signature, APIC_SIG, 4) != 0 || + ACPI_FAILURE(AcpiTbVerifyTableChecksum((void *)table))) continue; /* Save the address of the processor interrupt block. */ @@ -219,7 +221,8 @@ ia64_count_cpus(void) table = (MULTIPLE_APIC_TABLE *) IA64_PHYS_TO_RR7(xsdt->TableOffsetEntry[t]); - if (strncmp(table->Signature, APIC_SIG, 4) != 0) + if (strncmp(table->Signature, APIC_SIG, 4) != 0 || + ACPI_FAILURE(AcpiTbVerifyTableChecksum((void *)table))) continue; end = (char *)table + table->Length;