diff mbox

rrunner: fix buffer overflow

Message ID 20100102140846.GA5076@bicker
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter Jan. 2, 2010, 2:08 p.m. UTC
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.

Signed-off-by: Dan Carpenter <error27@gmail.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Jan. 4, 2010, 6:06 a.m. UTC | #1
From: Dan Carpenter <error27@gmail.com>
Date: Sat, 2 Jan 2010 16:08:46 +0200

> 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.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- orig/drivers/net/rrunner.c	2010-01-02 09:25:56.000000000 +0200
+++ devel/drivers/net/rrunner.c	2010-01-02 09:35:13.000000000 +0200
@@ -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);