]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix req->saved_syn race
authorEric Dumazet <edumazet@google.com>
Thu, 5 Nov 2015 19:07:13 +0000 (11:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Nov 2015 19:36:09 +0000 (14:36 -0500)
commit38883ef924cbe62b8b0535c353a6b2c5d92ec737
tree6e753b369a8f3663b5a50d3174b1a6fe0495714f
parent1b27c92e1d5907a55441968ce951f0267f340f58
tcp: fix req->saved_syn race

For the reasons explained in commit 4044ef548b37 ("tcp/dccp: fix
ireq->pktopts race"), we need to make sure we do not access
req->saved_syn unless we own the request sock.

This fixes races for listeners using TCP_SAVE_SYN option.

Fixes: 6c67d9803aed ("tcp: do not lock listener to process SYN packets")
Fixes: aaf9f4668c2b ("tcp/dccp: install syn_recv requests into ehash table")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Ying Cai <ycai@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv6/tcp_ipv6.c