]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Fix a connect() race with timewait sockets
authorEric Dumazet <eric.dumazet@gmail.com>
Fri, 4 Dec 2009 03:46:54 +0000 (03:46 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Dec 2009 04:17:51 +0000 (20:17 -0800)
commitd614c2b73b363db4fb5529f7634afa9794ce248f
tree3cee7de049a2468bef930b1832c42bd1b2e69e9a
parent51675a84aad3b626c6a1dbe3390b7a3c07a0c01a
tcp: Fix a connect() race with timewait sockets

First patch changes __inet_hash_nolisten() and __inet6_hash()
to get a timewait parameter to be able to unhash it from ehash
at same time the new socket is inserted in hash.

This makes sure timewait socket wont be found by a concurrent
writer in __inet_check_established()

Reported-by: kapil dakhane <kdakhane@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet6_hashtables.h
include/net/inet_hashtables.h
net/dccp/ipv4.c
net/dccp/ipv6.c
net/ipv4/inet_hashtables.c
net/ipv4/tcp_ipv4.c
net/ipv6/inet6_hashtables.c
net/ipv6/tcp_ipv6.c