Skip to content

Commit

Permalink
mptcp: ensure subflow is unhashed before cleaning the backlog
Browse files Browse the repository at this point in the history
While tacking care of the mptcp-level listener I unintentionally
moved the subflow level unhash after the subflow listener backlog
cleanup.

That could cause some nasty race and makes the code harder to read.

Address the issue restoring the proper order of operations.

Fixes: 57fc0f1 ("mptcp: ensure listener is unhashed before updating the sk status")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
Paolo Abeni authored and jenkins-tessares committed Jul 3, 2023
1 parent 51ccc85 commit 0fd9ddb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2909,10 +2909,10 @@ static void mptcp_check_listen_stop(struct sock *sk)
return;

lock_sock_nested(ssk, SINGLE_DEPTH_NESTING);
tcp_set_state(ssk, TCP_CLOSE);
mptcp_subflow_queue_clean(sk, ssk);
inet_csk_listen_stop(ssk);
mptcp_event_pm_listener(ssk, MPTCP_EVENT_LISTENER_CLOSED);
tcp_set_state(ssk, TCP_CLOSE);
release_sock(ssk);
}

Expand Down

0 comments on commit 0fd9ddb

Please sign in to comment.