⬢ DragonFlyBSD Kernel Audit
DF-5452 / fix.diff
← back to finding ↓ download raw
--- a/sys/platform/pc64/x86_64/nexus.c
+++ b/sys/platform/pc64/x86_64/nexus.c
@@ -374,8 +374,11 @@
 
 	switch (type) {
 	case SYS_RES_IRQ:
-		KASSERT(cpuid >= 0 && cpuid < ncpus,
-		    ("nexus invalid cpuid: %d", cpuid));
+		if (cpuid < 0 || cpuid >= ncpus) {
+			kprintf("nexus_alloc_resource: invalid cpuid %d for "
+			    "SYS_RES_IRQ allocation\n", cpuid);
+			return 0;
+		}
 		rm = &irq_rman[cpuid];
 		break;