This is a note to let you know that I've just added the patch titled mptcp: continue marking the first subflow as UNCONNECTED to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mptcp-continue-marking-the-first-subflow-as-unconnected.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From matttbe@xxxxxxxxxx Mon Mar 4 09:10:32 2024 From: "Matthieu Baerts (NGI0)" <matttbe@xxxxxxxxxx> Date: Wed, 28 Feb 2024 18:21:21 +0100 Subject: mptcp: continue marking the first subflow as UNCONNECTED To: stable@xxxxxxxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, sashal@xxxxxxxxxx Cc: MPTCP Upstream <mptcp@xxxxxxxxxxxxxxx>, "Matthieu Baerts (NGI0)" <matttbe@xxxxxxxxxx> Message-ID: <20240228172121.243458-2-matttbe@xxxxxxxxxx> From: "Matthieu Baerts (NGI0)" <matttbe@xxxxxxxxxx> After the 'Fixes' commit mentioned below, which is a partial backport, the MPTCP worker was no longer marking the first subflow as "UNCONNECTED" when the socket was transitioning to TCP_CLOSE state. As a result, in v6.1, it was no longer possible to reconnect to the just disconnected socket. Continue to do that like before, only for the first subflow. A few refactoring have been done around the 'msk->subflow' in later versions, and it looks like this is not needed to do that there, but still needed in v6.1. Without that, the 'disconnect' tests from the mptcp_connect.sh selftest fail: they repeat the transfer 3 times by reconnecting to the server each time. Fixes: 7857e35ef10e ("mptcp: get rid of msk->subflow") Signed-off-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/mptcp/protocol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index cdabb00648bd2..125825db642cc 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2440,6 +2440,8 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk, need_push = (flags & MPTCP_CF_PUSH) && __mptcp_retransmit_pending_data(sk); if (!dispose_it) { __mptcp_subflow_disconnect(ssk, subflow, flags); + if (msk->subflow && ssk == msk->subflow->sk) + msk->subflow->state = SS_UNCONNECTED; release_sock(ssk); goto out; -- 2.43.0 Patches currently in stable-queue which might be from matttbe@xxxxxxxxxx are queue-5.4/mptcp-continue-marking-the-first-subflow-as-unconnected.patch