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().
Unified · Split
| @@ -1581,8 +1581,7 @@ static bool filter_connect(struct tipc_sock *tsk, struct sk_buff *skb) · 1580 unmodified lines | |||
| 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); |