Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 265a9285 authored by Alexey Kuznetsov's avatar Alexey Kuznetsov Committed by David S. Miller
Browse files

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f5e6b9e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;							\
})