Commit 2585e7e5 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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.
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ec4e7d3
......@@ -1293,7 +1293,7 @@ static void rr_dump(struct net_device *dev)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment