All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: Joel Soete <soete.joel@scarlet.be>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH net-2.6] sundance: Fix oopses with corrupted skb_shared_info
Date: Sat, 25 Dec 2010 16:12:17 +0100	[thread overview]
Message-ID: <20101225151217.GA1994@del.dom.local> (raw)
In-Reply-To: <4D15F6C9.50700@scarlet.be>

[Was: Help: major pppoe regression since 2.6.35 (panic on first ppp
conection)?]

On Sat, Dec 25, 2010 at 01:51:05PM +0000, Joel Soete wrote:
> Hello Jarek,
Hello Joel,
...
> I don't have any more warnings :<)
> 
> Awesome job.

Awesome help.

Thanks and Happy New Year to you as well!
Jarek P.
-------------->

[PATCH net-2.6] 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>
---

diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 3ed2a67..b409d7e 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1016,7 +1016,7 @@ static void init_ring(struct net_device *dev)
 
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
-		struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
+		struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz + 2);
 		np->rx_skbuff[i] = skb;
 		if (skb == NULL)
 			break;
@@ -1407,7 +1407,7 @@ static void refill_rx (struct net_device *dev)
 		struct sk_buff *skb;
 		entry = np->dirty_rx % RX_RING_SIZE;
 		if (np->rx_skbuff[entry] == NULL) {
-			skb = dev_alloc_skb(np->rx_buf_sz);
+			skb = dev_alloc_skb(np->rx_buf_sz + 2);
 			np->rx_skbuff[entry] = skb;
 			if (skb == NULL)
 				break;		/* Better luck next round. */

  reply	other threads:[~2010-12-25 15:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 11:33 Help: major pppoe regression since 2.6.35 (panic on first ppp conection)? Joel Soete
2010-12-20 11:03 ` Joel Soete
2010-12-22  8:22 ` Andrew Morton
2010-12-22 11:00   ` Jarek Poplawski
2010-12-22 16:00     ` Joel Soete
2010-12-22 16:25       ` Eric Dumazet
2010-12-23 11:02         ` Joel Soete
2010-12-23 12:12           ` Eric Dumazet
2010-12-23 20:25             ` Jarek Poplawski
     [not found]               ` <4D148271.8030509@scarlet.be>
2010-12-24 15:13                 ` Jarek Poplawski
2010-12-25 12:10                   ` Jarek Poplawski
2010-12-25 13:51                     ` Joel Soete
2010-12-25 15:12                       ` Jarek Poplawski [this message]
2010-12-25 17:31                         ` [PATCH net-2.6] epic100: hamachi: yellowfin: Fix skb allocation size Jarek Poplawski
2010-12-25 17:39                         ` [PATCH net-2.6 v2] " Jarek Poplawski
2010-12-26  3:42                           ` David Miller
2010-12-26  3:42                         ` [PATCH net-2.6] sundance: Fix oopses with corrupted skb_shared_info David Miller
2010-12-26 11:01                           ` Jarek Poplawski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101225151217.GA1994@del.dom.local \
    --to=jarkao2@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=soete.joel@scarlet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.