[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A6B84A9.7020506@gmail.com>
Date: Sun, 26 Jul 2009 00:18:17 +0200
From: Roel Kluin <roel.kluin@...il.com>
To: khc@...waw.pl, netdev <netdev@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] lmc: Read outside array bounds
if dev_alloc_skb() fails on the first iteration of the allocation loop, and we
break out of the loop, then we end up writing before the start of the array.
Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 45b1822..ac8d5b2 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1865,7 +1865,7 @@ static void lmc_softreset (lmc_softc_t * const sc) /*fold00*/
if(skb == NULL){
printk(KERN_WARNING "%s: Failed to allocate receiver ring, will try again
", sc->name);
sc->failed_ring = 1;
- break;
+ return;
}
else{
sc->lmc_rxq[i] = skb;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists