[PATCH] cyclades: Read buffer overflow

From: Roel Kluin
Date: Sat Jul 25 2009 - 18:57:22 EST


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)

Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
---
Credits to Parfait

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 2dafc2d..d067705 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/