Skip to contentSkip to conversation

cyclades: Read buffer overflow

PATCH New Roel Kluin 1 participant 1 message Jul 25, 2009 Char and misc drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 cyclades: Read buffer overflow

irq is declared with size NR_CARDS (4), but the loop containing this segment runs up until NR_ISA_ADDRS (16), possibly reading from irq[i] (and trying to use the result)

---
Credits to Parfait

drivers/char/cyclades.c +1 -1
index 2dafc2d..d067705 100644
@@ -4535,7 +4535,7 @@ static int __init cy_detect_isa(void)
 			continue;
 		}
 #ifdef MODULE
-		if (isparam && irq[i])
+		if (isparam && i < NR_CARDS && irq[i])
 			cy_isa_irq = irq[i];
 		else
 #endif