]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:46:42 +0000 (10:46 +0200)
commit484cd180464f724ffa128a668fd60fc783894a96
treef94c4db794a406ed4073ae1b0d77474a6f3817e6
parent2e782b9931b67d78efa9ac0c9c5b1400ef0d23cf
net: adjust skb->truesize in ___pskb_trim()

BugLink: http://bugs.launchpad.net/bugs/1691369
[ Upstream commit c21b48cc1bbf2f5af3ef54ada559f7fadf8b508b ]

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 158f323b9868 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
net/core/skbuff.c