netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Krzysztof Oledzki <ole@ans.pl>
Cc: Marco Berizzi <pupilla@hotmail.com>, netdev@vger.kernel.org
Subject: Re: WARNING: at net/core/skbuff.c:154 with tcpdump and ipsec
Date: Fri, 13 Feb 2009 12:14:24 +0000	[thread overview]
Message-ID: <20090213121424.GA8717@ff.dom.local> (raw)
In-Reply-To: <alpine.LNX.1.10.0902111641280.13501@bizon.gios.gov.pl>

On 11-02-2009 16:55, Krzysztof Oledzki wrote:
> 
> On Wed, 11 Feb 2009, Marco Berizzi wrote:
> 
>> Hi Folks,
>>
>> I'm getting this error on 2.6.28.4 when I run tcpdump on
>> the interface where ipsec packets are enc/decrypted.
>>
>> TIA
>>
>>> Feb 11 10:53:55 Pleiadi kernel: ------------[ cut here ]------------
>>> Feb 11 10:53:55 Pleiadi kernel: WARNING: at net/core/skbuff.c:154 skb_truesize_bug+0x2e/0x33()
>>> Feb 11 10:53:55 Pleiadi kernel: SKB BUG: Invalid truesize (268) len=134, sizeof(sk_buff)=172
> <CUT>
> 
> This annoying problem is quite old (appeared in 2.6.25) and already known:
>   http://bugzilla.kernel.org/show_bug.cgi?id=10996
> 
> Sadly, no one is interested in fixing it. :(

Here is a debugging patch doing these checks a bit earlier, so maybe
we get something new and interesting. ;)

Thanks,
Jarek P.
---

 include/linux/skbuff.h |    8 ++++++--
 net/packet/af_packet.c |    9 +++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index cf2cb50..20c3182 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -418,12 +418,16 @@ extern void	      skb_under_panic(struct sk_buff *skb, int len,
 				      void *here);
 extern void	      skb_truesize_bug(struct sk_buff *skb);
 
-static inline void skb_truesize_check(struct sk_buff *skb)
+static inline int skb_truesize_check(struct sk_buff *skb)
 {
 	int len = sizeof(struct sk_buff) + skb->len;
 
-	if (unlikely((int)skb->truesize < len))
+	if (unlikely((int)skb->truesize < len)) {
 		skb_truesize_bug(skb);
+		return 1;
+	}
+
+	return 0;
 }
 
 extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1fc4a78..08200be 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -307,6 +307,9 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev,  struct
 	if (dev_net(dev) != sock_net(sk))
 		goto out;
 
+	if (skb_truesize_check(skb))
+		goto out;
+
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
 		goto oom;
 
@@ -495,6 +498,9 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
 	if (dev_net(dev) != sock_net(sk))
 		goto drop;
 
+	if (skb_truesize_check(skb))
+		goto drop;
+
 	skb->dev = dev;
 
 	if (dev->header_ops) {
@@ -617,6 +623,9 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
 	if (dev_net(dev) != sock_net(sk))
 		goto drop;
 
+	if (skb_truesize_check(skb))
+		goto drop;
+
 	if (dev->header_ops) {
 		if (sk->sk_type != SOCK_DGRAM)
 			skb_push(skb, skb->data - skb_mac_header(skb));

  parent reply	other threads:[~2009-02-13 12:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11 15:26 WARNING: at net/core/skbuff.c:154 with tcpdump and ipsec Marco Berizzi
2009-02-11 15:55 ` Krzysztof Oledzki
2009-02-11 18:25   ` Jarek Poplawski
2009-02-13 12:14   ` Jarek Poplawski [this message]
2009-02-13 18:56     ` Vlad Yasevich
2009-02-13 19:24       ` Jarek Poplawski
2009-02-13 19:42         ` Vlad Yasevich
2009-02-13 20:00           ` Jarek Poplawski
2009-02-14  2:24             ` David Miller
2009-02-18  9:13               ` David Miller

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=20090213121424.GA8717@ff.dom.local \
    --to=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ole@ans.pl \
    --cc=pupilla@hotmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).