svn commit: r315402 - head/sys/x86/acpica

Roger Pau Monné royger at FreeBSD.org
Thu Mar 16 09:33:38 UTC 2017


Author: royger
Date: Thu Mar 16 09:33:36 2017
New Revision: 315402
URL: https://svnweb.freebsd.org/changeset/base/315402

Log:
  x86/srat: fix parsing of APIC IDs > MAX_APIC_ID
  
  Ignore them like it's done in the MADT parser. This allows booting on a box
  with SRAT and APIC IDs > 255.
  
  Reported by:	Wei Liu <wei.liu2 at citrix.com>
  Tested by:	Wei Liu <wei.liu2 at citrix.com>
  Reviewed by:	kib
  MFC after:	2 weeks
  Sponsored by:	Citrix Systems R&D

Modified:
  head/sys/x86/acpica/srat.c

Modified: head/sys/x86/acpica/srat.c
==============================================================================
--- head/sys/x86/acpica/srat.c	Thu Mar 16 09:17:14 2017	(r315401)
+++ head/sys/x86/acpica/srat.c	Thu Mar 16 09:33:36 2017	(r315402)
@@ -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;


More information about the svn-src-head mailing list