]> git.baikalelectronics.ru Git - kernel.git/commit
net: adjust skb->truesize in ___pskb_trim()
authorEric Dumazet <edumazet@google.com>
Wed, 26 Apr 2017 16:07:46 +0000 (09:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Apr 2017 20:06:47 +0000 (16:06 -0400)
commitfaf0ab57b068fed16cd77242eca7a115676dcb2c
treea350a8306a8b8e0d502d57374aef0967d2944b5f
parentf150cb67959447179d62dcdd32f97303d028f016
net: adjust skb->truesize in ___pskb_trim()

Andrey found a way to trigger the WARN_ON_ONCE(delta < len) in
skb_try_coalesce() using syzkaller and a filter attached to a TCP
socket.

As we did recently in commit 8e381bb20844 ("net: adjust skb->truesize in
pskb_expand_head()") we can adjust skb->truesize from ___pskb_trim(),
via a call to skb_condense().

If all frags were freed, then skb->truesize can be recomputed.

This call can be done if skb is not yet owned, or destructor is
sock_edemux().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c