path: root/net
diff options
authorPaolo Abeni <>2021-02-19 18:35:40 +0100
committerJakub Kicinski <>2021-02-22 18:54:59 -0800
commit52557dbc7538ecceb27ef2206719a47a8039a335 (patch)
treef408921b80f8f4659198c29569f578d99d153428 /net
parentad98dd37051e14fa8c785609430d907fcfd518ba (diff)
mptcp: do not wakeup listener for MPJ subflows
MPJ subflows are not exposed as fds to user spaces. As such, incoming MPJ subflows are removed from the accept queue by tcp_check_req()/tcp_get_cookie_sock(). Later tcp_child_process() invokes subflow_data_ready() on the parent socket regardless of the subflow kind, leading to poll wakeups even if the later accept will block. Address the issue by double-checking the queue state before waking the user-space. Closes: Reported-by: Dr. David Alan Gilbert <> Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests") Reviewed-by: Mat Martineau <> Signed-off-by: Paolo Abeni <> Signed-off-by: Jakub Kicinski <>
Diffstat (limited to 'net')
1 files changed, 6 insertions, 0 deletions
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 06e233410e0e..e1fbcab257e6 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1096,6 +1096,12 @@ static void subflow_data_ready(struct sock *sk)
msk = mptcp_sk(parent);
if (state & TCPF_LISTEN) {
+ /* MPJ subflow are removed from accept queue before reaching here,
+ * avoid stray wakeups
+ */
+ if (reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue))
+ return;
set_bit(MPTCP_DATA_READY, &msk->flags);