summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2021-02-19 18:35:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-07 12:35:47 +0100
commitd3b762715998a001cfb6eac5f6fc93a702e5679d (patch)
tree1919205c041e898864e74437e3287a9cb23082e1 /net
parentc90751e08834e212cf45c95f10d27a661d55cf29 (diff)
downloadlinux-stable-d3b762715998a001cfb6eac5f6fc93a702e5679d.tar.gz
linux-stable-d3b762715998a001cfb6eac5f6fc93a702e5679d.tar.bz2
linux-stable-d3b762715998a001cfb6eac5f6fc93a702e5679d.zip
mptcp: do not wakeup listener for MPJ subflows
commit 52557dbc7538ecceb27ef2206719a47a8039a335 upstream. 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: https://github.com/multipath-tcp/mptcp_net-next/issues/164 Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Fixes: f296234c98a8 ("mptcp: Add handling of incoming MP_JOIN requests") Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/mptcp/subflow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 278cbe3e539e..9d28f6e3dc49 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -1026,6 +1026,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);
parent->sk_data_ready(parent);
return;