Commit c21b48cc authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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

As we did recently in commit 158f323b

 ("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
Signed-off-by: default avatarEric Dumazet <>
Reported-by: default avatarAndrey Konovalov <>
Cc: Willem de Bruijn <>
Signed-off-by: default avatarDavid S. Miller <>
parent 7162fb24
......@@ -1576,6 +1576,8 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len)
skb_set_tail_pointer(skb, len);
if (!skb->sk || skb->destructor == sock_edemux)
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment