Author: royger Date: Fri Mar 31 10:26:14 2017 New Revision: 316330 URL: https://svnweb.freebsd.org/changeset/base/316330
Log: MFC r315402: x86/srat: fix parsing of APIC IDs > MAX_APIC_ID Modified: stable/11/sys/x86/acpica/srat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/acpica/srat.c ============================================================================== --- stable/11/sys/x86/acpica/srat.c Fri Mar 31 09:26:08 2017 (r316329) +++ stable/11/sys/x86/acpica/srat.c Fri Mar 31 10:26:14 2017 (r316330) @@ -202,6 +202,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED)) break; + if (cpu->ApicId > MAX_APIC_ID) { + printf("SRAT: Ignoring local APIC ID %u (too high)\n", + cpu->ApicId); + break; + } + if (cpus[cpu->ApicId].enabled) { printf("SRAT: Duplicate local APIC ID %u\n", cpu->ApicId); @@ -220,6 +226,12 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *e "enabled" : "disabled"); if (!(x2apic->Flags & ACPI_SRAT_CPU_ENABLED)) break; + if (x2apic->ApicId > MAX_APIC_ID) { + printf("SRAT: Ignoring local APIC ID %u (too high)\n", + x2apic->ApicId); + break; + } + KASSERT(!cpus[x2apic->ApicId].enabled, ("Duplicate local APIC ID %u", x2apic->ApicId)); cpus[x2apic->ApicId].domain = x2apic->ProximityDomain; _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"