]> git.hungrycats.org Git - linux/commit
tcp: make sure skb is not shared before using skb_get()
authorEric Dumazet <edumazet@google.com>
Fri, 13 Feb 2015 12:47:12 +0000 (04:47 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 13:10:48 +0000 (14:10 +0100)
commitb73f6e471cdd6c4474aff6b6301af2779462d98d
tree14e298843ecdacb38e6707b2ae5433fd5a93fba9
parent9519ba7401b98c4c882d06b218d14dce45fcb7c1
tcp: make sure skb is not shared before using skb_get()

[ Upstream commit ba34e6d9d346fe4e05d7e417b9edf5140772d34c ]

IPv6 can keep a copy of SYN message using skb_get() in
tcp_v6_conn_request() so that caller wont free the skb when calling
kfree_skb() later.

Therefore TCP fast open has to clone the skb it is queuing in
child->sk_receive_queue, as all skbs consumed from receive_queue are
freed using __kfree_skb() (ie assuming skb->users == 1)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Fixes: 5b7ed0892f2af ("tcp: move fastopen functions to tcp_fastopen.c")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_fastopen.c