Skip to contentSkip to conversation

rrunner: fix buffer overflow

PATCH Applied Dan Carpenter 2 participants 2 messages Jan 2, 2010 – Jan 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rrunner: fix buffer overflow

tx_skbuff is define as:

        struct sk_buff          *tx_skbuff[TX_RING_ENTRIES];

EVT_RING_ENTRIES is 64 and TX_RING_ENTRIES is 32.

This function is in a error path so that's why it wasn't noticed.

drivers/net/rrunner.c +1 -1
@@ -1293,7 +1293,7 @@ static void rr_dump(struct net_device *d
 
 	printk("Error code 0x%x\n", readl(&regs->Fail1));
 
-	index = (((readl(&regs->EvtPrd) >> 8) & 0xff ) - 1) % EVT_RING_ENTRIES;
+	index = (((readl(&regs->EvtPrd) >> 8) & 0xff) - 1) % TX_RING_ENTRIES;
 	cons = rrpriv->dirty_tx;
 	printk("TX ring index %i, TX consumer %i\n",
 	       index, cons);
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Sat, 2 Jan 2010 16:08:46 +0200

Quoted 8 lines

tx_skbuff is define as:

        struct sk_buff          *tx_skbuff[TX_RING_ENTRIES];

EVT_RING_ENTRIES is 64 and TX_RING_ENTRIES is 32.

This function is in a error path so that's why it wasn't noticed.

Applied.