]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: do not recycle cloned skbs
authorEric Dumazet <edumazet@google.com>
Wed, 15 May 2019 16:10:15 +0000 (09:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 May 2019 16:22:41 +0000 (09:22 -0700)
commit71dfc8325bb0986ed651cde4acd303963fe574e0
tree373f0ffe2041cc465d0c0582b27da70f6179d7ee
parent8e318c0c96ed8c21d24df41799d7635f885196ae
tcp: do not recycle cloned skbs

It is illegal to change arbitrary fields in skb_shared_info if the
skb is cloned.

Before calling skb_zcopy_clear() we need to ensure this rule,
therefore we need to move the test from sk_stream_alloc_skb()
to sk_wmem_free_skb()

Fixes: e9b62202b2b5 ("tcp: fix zerocopy and notsent_lowat issues")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/ipv4/tcp.c