Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639731 > unrolled thread

[PATCH 4.10 107/129] net: adjust skb->truesize in ___pskb_trim()

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-05-11 17:30 +0200
Last post2017-05-11 17:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.10 107/129] net: adjust skb->truesize in ___pskb_trim() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-11 17:30 +0200

#1639731 — [PATCH 4.10 107/129] net: adjust skb->truesize in ___pskb_trim()

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-05-11 17:30 +0200
Subject[PATCH 4.10 107/129] net: adjust skb->truesize in ___pskb_trim()
Message-ID<tFYcq-859-19@gated-at.bofh.it>
4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>


[ 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>
---
 net/core/skbuff.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1572,6 +1572,8 @@ done:
 		skb_set_tail_pointer(skb, len);
 	}
 
+	if (!skb->sk || skb->destructor == sock_edemux)
+		skb_condense(skb);
 	return 0;
 }
 EXPORT_SYMBOL(___pskb_trim);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web