Patch "mptcp: don't orphan ssk in mptcp_close()" has been added to the 6.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mptcp: don't orphan ssk in mptcp_close()

to the 6.0-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-don-t-orphan-ssk-in-mptcp_close.patch
and it can be found in the queue-6.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9b9deffc3157520332a896598747bf1d265ed226
Author: Menglong Dong <imagedong@xxxxxxxxxxx>
Date:   Mon Nov 28 16:42:37 2022 +0100

    mptcp: don't orphan ssk in mptcp_close()
    
    [ Upstream commit fe94800184f22d4778628f1321dce5acb7513d84 ]
    
    All of the subflows of a msk will be orphaned in mptcp_close(), which
    means the subflows are in DEAD state. After then, DATA_FIN will be sent,
    and the other side will response with a DATA_ACK for this DATA_FIN.
    
    However, if the other side still has pending data, the data that received
    on these subflows will not be passed to the msk, as they are DEAD and
    subflow_data_ready() will not be called in tcp_data_ready(). Therefore,
    these data can't be acked, and they will be retransmitted again and again,
    until timeout.
    
    Fix this by setting ssk->sk_socket and ssk->sk_wq to 'NULL', instead of
    orphaning the subflows in __mptcp_close(), as Paolo suggested.
    
    Fixes: e16163b6e2b7 ("mptcp: refactor shutdown and close")
    Reviewed-by: Biao Jiang <benbjiang@xxxxxxxxxxx>
    Reviewed-by: Mengen Sun <mengensun@xxxxxxxxxxx>
    Signed-off-by: Menglong Dong <imagedong@xxxxxxxxxxx>
    Reviewed-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Matthieu Baerts <matthieu.baerts@xxxxxxxxxxxx>
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b568f55998f3..42d5e0a7952a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2297,12 +2297,7 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
 		goto out;
 	}
 
-	/* if we are invoked by the msk cleanup code, the subflow is
-	 * already orphaned
-	 */
-	if (ssk->sk_socket)
-		sock_orphan(ssk);
-
+	sock_orphan(ssk);
 	subflow->disposable = 1;
 
 	/* if ssk hit tcp_done(), tcp_cleanup_ulp() cleared the related ops
@@ -2833,7 +2828,11 @@ bool __mptcp_close(struct sock *sk, long timeout)
 		if (ssk == msk->first)
 			subflow->fail_tout = 0;
 
-		sock_orphan(ssk);
+		/* detach from the parent socket, but allow data_ready to
+		 * push incoming data into the mptcp stack, to properly ack it
+		 */
+		ssk->sk_socket = NULL;
+		ssk->sk_wq = NULL;
 		unlock_sock_fast(ssk, slow);
 	}
 	sock_orphan(sk);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux