Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, slavash@mellanox.com
Subject: Re: [PATCH v2 net-next] net: adjust skb->truesize in pskb_expand_head()
Date: Fri, 27 Jan 2017 12:03:44 -0500 (EST)	[thread overview]
Message-ID: <20170127.120344.536515545735368429.davem@davemloft.net> (raw)
In-Reply-To: <1485529887.6360.50.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 27 Jan 2017 07:11:27 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> Slava Shwartsman reported a warning in skb_try_coalesce(), when we
> detect skb->truesize is completely wrong.
> 
> In his case, issue came from IPv6 reassembly coping with malicious
> datagrams, that forced various pskb_may_pull() to reallocate a bigger
> skb->head than the one allocated by NIC driver before entering GRO
> layer.
> 
> Current code does not change skb->truesize, leaving this burden to
> callers if they care enough.
> 
> Blindly changing skb->truesize in pskb_expand_head() is not
> easy, as some producers might track skb->truesize, for example
> in xmit path for back pressure feedback (sk->sk_wmem_alloc)
> 
> We can detect the cases where it should be safe to change
> skb->truesize :
> 
> 1) skb is not attached to a socket.
> 2) If it is attached to a socket, destructor is sock_edemux()
> 
> My audit gave only two callers doing their own skb->truesize
> manipulation.
> 
> I had to remove skb parameter in sock_edemux macro when
> CONFIG_INET is not set to avoid a compile error.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Slava Shwartsman <slavash@mellanox.com>

Looks good, applied, thanks Eric.

      reply	other threads:[~2017-01-27 17:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27  0:21 [PATCH net-next] net: adjust skb->truesize in pskb_expand_head() Eric Dumazet
2017-01-27  2:22 ` kbuild test robot
2017-01-27  2:34   ` Eric Dumazet
2017-01-27 10:49 ` David Laight
2017-01-27 14:44   ` Eric Dumazet
2017-01-27 15:46     ` David Laight
2017-01-27 16:14       ` Eric Dumazet
2017-01-27 17:24     ` David Laight
2017-01-27 18:16       ` Eric Dumazet
2017-01-27 15:11 ` [PATCH v2 " Eric Dumazet
2017-01-27 17:03   ` David Miller [this message]

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=20170127.120344.536515545735368429.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=slavash@mellanox.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