Skip to content

Commit

Permalink
tipc: Fix missing connection request handling
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Parthasarathy Bhuvaragan authored and davem330 committed Apr 28, 2017
1 parent f832460 commit 42b531d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,8 +1581,7 @@ static bool filter_connect(struct tipc_sock *tsk, struct sk_buff *skb)
return true;

/* If empty 'ACK-' message, wake up sleeping connect() */
if (waitqueue_active(sk_sleep(sk)))
wake_up_interruptible(sk_sleep(sk));
sk->sk_data_ready(sk);

/* 'ACK-' message is neither accepted nor rejected: */
msg_set_dest_droppable(hdr, 1);
Expand Down

0 comments on commit 42b531d

Please sign in to comment.