Commit ce2e1c6d authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'mptcp-more-fixes-for-6-1'

Matthieu Baerts says:

====================
mptcp: More fixes for 6.1

Patch 1 makes sure data received after a close will still be processed
and acked as exepected. This is a regression for a commit introduced
in v5.11.

Patch 2 fixes a kernel deadlock found when working on validating TFO
with a listener MPTCP socket. This is not directly linked to TFO but
it is easier to reproduce the issue with it. This fixes a bug introduced
by a commit from v6.0.
====================

Link: https://lore.kernel.org/r/20221128154239.1999234-1-matthieu.baerts@tessares.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 39f59bca b4f16665
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2354,12 +2354,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);

	subflow->disposable = 1;

	/* if ssk hit tcp_done(), tcp_cleanup_ulp() cleared the related ops
@@ -2940,7 +2935,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);
+3 −3
Original line number Diff line number Diff line
@@ -1745,16 +1745,16 @@ void mptcp_subflow_queue_clean(struct sock *listener_ssk)

	for (msk = head; msk; msk = next) {
		struct sock *sk = (struct sock *)msk;
		bool slow, do_cancel_work;
		bool do_cancel_work;

		sock_hold(sk);
		slow = lock_sock_fast_nested(sk);
		lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
		next = msk->dl_next;
		msk->first = NULL;
		msk->dl_next = NULL;

		do_cancel_work = __mptcp_close(sk, 0);
		unlock_sock_fast(sk, slow);
		release_sock(sk);
		if (do_cancel_work)
			mptcp_cancel_work(sk);
		sock_put(sk);