diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2010-12-25 00:12:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-25 22:37:49 -0500 |
commit | 78a36f25478432835f2f1e46202b71ff3ae454ff (patch) | |
tree | 46781d07ae6bc93661e8b7a802f77f37f57c725f /drivers/net/sundance.c | |
parent | e058464990c2ef1f3ecd6b83a154913c3c06f02a (diff) |
sundance: Fix oopses with corrupted skb_shared_info
Joel Soete reported oopses at the beginning of pppoe connections since
v2.6.35. After debugging the bug was found in sundance skb allocation
and dma mapping code, where skb_reserve() bytes aren't taken into
account. This is an old bug, only uncovered by some change in 2.6.35.
Initial debugging patch by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: Joel Soete <soete.joel@scarlet.be>
Tested-by: Joel Soete <soete.joel@scarlet.be>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sundance.c')
-rw-r--r-- | drivers/net/sundance.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 3ed2a67bd6d3..b409d7ec4ac1 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -1016,7 +1016,7 @@ static void init_ring(struct net_device *dev) | |||
1016 | 1016 | ||
1017 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 1017 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
1018 | for (i = 0; i < RX_RING_SIZE; i++) { | 1018 | for (i = 0; i < RX_RING_SIZE; i++) { |
1019 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz); | 1019 | struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2); |
1020 | np->rx_skbuff[i] = skb; | 1020 | np->rx_skbuff[i] = skb; |
1021 | if (skb == NULL) | 1021 | if (skb == NULL) |
1022 | break; | 1022 | break; |
@@ -1407,7 +1407,7 @@ static void refill_rx (struct net_device *dev) | |||
1407 | struct sk_buff *skb; | 1407 | struct sk_buff *skb; |
1408 | entry = np->dirty_rx % RX_RING_SIZE; | 1408 | entry = np->dirty_rx % RX_RING_SIZE; |
1409 | if (np->rx_skbuff[entry] == NULL) { | 1409 | if (np->rx_skbuff[entry] == NULL) { |
1410 | skb = dev_alloc_skb(np->rx_buf_sz); | 1410 | skb = dev_alloc_skb(np->rx_buf_sz + 2); |
1411 | np->rx_skbuff[entry] = skb; | 1411 | np->rx_skbuff[entry] = skb; |
1412 | if (skb == NULL) | 1412 | if (skb == NULL) |
1413 | break; /* Better luck next round. */ | 1413 | break; /* Better luck next round. */ |