MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-net] mptcp: ensure subflow is unhashed before cleaning the backlog
@ 2023-06-23 14:51 Paolo Abeni
  2023-06-23 16:13 ` mptcp: ensure subflow is unhashed before cleaning the backlog: Tests Results MPTCP CI
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Paolo Abeni @ 2023-06-23 14:51 UTC (permalink / raw)
  To: mptcp

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: 57fc0f1ceaa4 ("mptcp: ensure listener is unhashed before updating the sk status")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index f2abae254524..03a7c83bc2d2 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2957,10 +2957,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);
 }
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-26 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-23 14:51 [PATCH mptcp-net] mptcp: ensure subflow is unhashed before cleaning the backlog Paolo Abeni
2023-06-23 16:13 ` mptcp: ensure subflow is unhashed before cleaning the backlog: Tests Results MPTCP CI
2023-06-26 13:20 ` [PATCH mptcp-net] mptcp: ensure subflow is unhashed before cleaning the backlog Matthieu Baerts
2023-06-26 15:03   ` Paolo Abeni
2023-06-26 13:59 ` Matthieu Baerts
2023-06-26 14:28 ` mptcp: ensure subflow is unhashed before cleaning the backlog: Tests Results MPTCP CI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox