]> git.baikalelectronics.ru Git - kernel.git/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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Feb 2015 15:11:40 +0000 (07:11 -0800)
commit00dd0cafae6183f15728fbd2722fe7606abf05db
treec0470809aa6a3e92fce6c0b37757ab58e75e9dc5
parentdd07987193e22a10140075a330c31bae894e0cf7
tcp: make sure skb is not shared before using skb_get()

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: b051086d3ac00 ("tcp: move fastopen functions to tcp_fastopen.c")
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_fastopen.c