diff options
author | Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com> | 2017-04-26 04:05:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-28 12:20:42 -0400 |
commit | 42b531de17d2f6bb9293f23398f6d9bb94635c3e (patch) | |
tree | d4df7e1da29816011a2c74a592969288b391bfa2 /net/tipc/socket.c | |
parent | f83246089ca09308425175d47f5e71e6da68b2ef (diff) |
tipc: Fix missing connection request handling
In filter_connect, we use waitqueue_active() to check for any
connections to wakeup. But waitqueue_active() is missing memory
barriers while accessing the critical sections, leading to
inconsistent results.
In this commit, we replace this with an SMP safe wq_has_sleeper()
using the generic socket callback sk_data_ready().
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 566906795c8c..3b8df510a80c 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -1581,8 +1581,7 @@ static bool filter_connect(struct tipc_sock *tsk, struct sk_buff *skb) | |||
1581 | return true; | 1581 | return true; |
1582 | 1582 | ||
1583 | /* If empty 'ACK-' message, wake up sleeping connect() */ | 1583 | /* If empty 'ACK-' message, wake up sleeping connect() */ |
1584 | if (waitqueue_active(sk_sleep(sk))) | 1584 | sk->sk_data_ready(sk); |
1585 | wake_up_interruptible(sk_sleep(sk)); | ||
1586 | 1585 | ||
1587 | /* 'ACK-' message is neither accepted nor rejected: */ | 1586 | /* 'ACK-' message is neither accepted nor rejected: */ |
1588 | msg_set_dest_droppable(hdr, 1); | 1587 | msg_set_dest_droppable(hdr, 1); |