public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [RFC/T] [NET] give truesize warning when truesize differs
Date: Mon, 05 May 2008 15:11:20 +0200	[thread overview]
Message-ID: <1209993080.8245.16.camel@johannes.berg> (raw)
In-Reply-To: <1209924728.3655.7.camel@johannes.berg>

[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]

On Sun, 2008-05-04 at 20:12 +0200, Johannes Berg wrote:
> This patch makes the truesize warning be printed when the truesize
> actually changed, not just when the header was increased and the
> additional size actually used.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> ---
> It'll trigger with mac80211, should hold it until I fixed that.
> 
>  include/linux/skbuff.h |    8 ++++++--
>  net/core/skbuff.c      |   10 ++++++++--
>  2 files changed, 14 insertions(+), 4 deletions(-)
> 
> --- everything.orig/include/linux/skbuff.h	2008-05-03 15:47:00.000000000 +0200
> +++ everything/include/linux/skbuff.h	2008-05-04 00:30:34.000000000 +0200
> @@ -387,9 +387,13 @@ extern void	      skb_truesize_bug(struc
>  
>  static inline void skb_truesize_check(struct sk_buff *skb)
>  {
> -	int len = sizeof(struct sk_buff) + skb->len;
> +#ifdef NET_SKBUFF_DATA_USES_OFFSET
> +	int len = sizeof(struct sk_buff) + skb->end;
> +#else
> +	int len = sizeof(struct sk_buff) + (skb->end - skb->head);
> +#endif

Umm, is this even correct? Should it check data_len? I seem to get the
truesize warning a bit now:

[11381.081709] SKB BUG: Invalid truesize (16864) size=4112, sizeof(sk_buff)=272
[11381.081725] last reallocate at:
[11381.081729]  [<c0274194>] __alloc_skb+0xdc/0x140
[11381.081745]  [<c02aeca8>] sk_stream_alloc_skb+0x38/0x134
[11381.081758]  [<c02af16c>] tcp_sendmsg+0x3c8/0xcbc
[11381.081767]  [<c026bcc4>] sock_sendmsg+0xac/0xe4
[11381.081780]  [<c026c058>] sys_sendto+0xbc/0xec
[11381.081790]  [<c026cbc8>] sys_socketcall+0x14c/0x1dc
[11381.081800]  [<c00124cc>] ret_from_syscall+0x0/0x38


johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  parent reply	other threads:[~2008-05-05 13:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04 18:12 [RFC/T] [NET] give truesize warning when truesize differs Johannes Berg
2008-05-04 22:09 ` Johannes Berg
2008-05-05 13:11 ` Johannes Berg [this message]
2008-05-05 15:04   ` Herbert Xu
2008-05-05 15:22     ` Johannes Berg

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=1209993080.8245.16.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    /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