Skip to contentSkip to conversation

Overflow check for i386 assign_irq_vector, 2.6.0-test5

PATCH New James Cleverdon 1 participant 1 message Sep 12, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Overflow check for i386 assign_irq_vector, 2.6.0-test5

Some very large systems overflow the array and corrupt memory. A BUG_ON will at least flag the problem until dynamic irq_vector allocation is added.

Signature · 3 lines
James Cleverdon
IBM xSeries Linux Solutions
{jamesclv(Unix, preferred), cleverdj(Notes)} at us dot ibm dot comm
arch/i386/kernel/io_apic.c +1 -0
diff -pru 2.6.0-test5/arch/i386/kernel/io_apic.c t5/arch/i386/kernel/io_apic.c
@@ -1143,6 +1143,7 @@ int irq_vector[NR_IRQS] = { FIRST_DEVICE
 static int __init assign_irq_vector(int irq)
 {
 	static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
+	BUG_ON(irq >= NR_IRQS);
 	if (IO_APIC_VECTOR(irq) > 0)
 		return IO_APIC_VECTOR(irq);
 next: