[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091208.201900.109640288.davem@davemloft.net>
Date: Tue, 08 Dec 2009 20:19:00 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: kdakhane@...il.com, netdev@...r.kernel.org,
netfilter@...r.kernel.org, zbr@...emap.net
Subject: Re: [PATCH 2/2] tcp: Fix a connect() race with timewait sockets
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Fri, 04 Dec 2009 14:47:42 +0100
> When we find a timewait connection in __inet_hash_connect() and reuse
> it for a new connection request, we have a race window, releasing bind
> list lock and reacquiring it in __inet_twsk_kill() to remove timewait
> socket from list.
>
> Another thread might find the timewait socket we already chose, leading to
> list corruption and crashes.
>
> Fix is to remove timewait socket from bind list before releasing the bind lock.
>
> Note: This problem happens if sysctl_tcp_tw_reuse is set.
>
> Reported-by: kapil dakhane <kdakhane@...il.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
Applied and queued up for -stable, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists