From: Alexey Kuznetsov Date: Sat, 18 Mar 2006 00:05:43 +0000 (-0800) Subject: [NET]: Fix race condition in sk_wait_event(). X-Git-Tag: v2.6.16~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=265a92856b17524c87da0258ac0d3cec80ae1d35;p=linux-2.6 [NET]: Fix race condition in sk_wait_event(). It is broken, the condition is checked out of socket lock. It is wonderful the bug survived for so long time. [ This fixes bugzilla #6233: race condition in tcp_sendmsg when connection became established ] Signed-off-by: David S. Miller --- diff --git a/include/net/sock.h b/include/net/sock.h index 30758035d6..f63d0d5671 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -478,9 +478,9 @@ static inline void sk_add_backlog(struct sock *sk, struct sk_buff *skb) rc = __condition; \ if (!rc) { \ *(__timeo) = schedule_timeout(*(__timeo)); \ - rc = __condition; \ } \ lock_sock(__sk); \ + rc = __condition; \ rc; \ })