FAILED: patch "[PATCH] mptcp: fix more tx path fields initialization" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 3f83d8a77eeeb47011b990fd766a421ee64f1d73
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024021910-cold-outmost-b825@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
3f83d8a77eee ("mptcp: fix more tx path fields initialization") 013e3179dbd2 ("mptcp: fix rcv space initialization") c693a8516429 ("mptcp: use mptcp_set_state")4fd19a307016 ("mptcp: fix inconsistent state on fastopen race") d109a7767273 ("mptcp: fix possible NULL pointer dereference on close") 8005184fd1ca ("mptcp: refactor sndbuf auto-tuning")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3f83d8a77eeeb47011b990fd766a421ee64f1d73 Mon Sep 17 00:00:00 2001
From: Paolo Abeni <[email protected]>
Date: Thu, 8 Feb 2024 19:03:51 +0100
Subject: [PATCH] mptcp: fix more tx path fields initialization
The 'msk->write_seq' and 'msk->snd_nxt' are always updated under the msk socket lock, except at MPC handshake completiont time.
Builds-up on the previous commit to move such init under the relevant lock.
There are no known problems caused by the potential race, the primary goal is consistency.
net/mptcp/protocol.c +2 -4
@@ -3478,10 +3478,8 @@ void mptcp_finish_connect(struct sock *ssk)* accessing the field below */ WRITE_ONCE (msk->local_key, subflow->local_key); -WRITE_ONCE (msk->write_seq, subflow->idsn +1 ); -WRITE_ONCE (msk->snd_nxt, msk->write_seq); -WRITE_ONCE (msk->snd_una, msk->write_seq); -WRITE_ONCE (msk->wnd_end, msk->snd_nxt +tcp_sk (ssk)->snd_wnd); +WRITE_ONCE (msk->snd_una, subflow->idsn +1 ); +WRITE_ONCE (msk->wnd_end, subflow->idsn +1 +tcp_sk (ssk)->snd_wnd);mptcp_pm_new_connection (msk, ssk,0 ); }
net/mptcp/subflow.c +11 -2
@@ -421,12 +421,21 @@ static bool subflow_use_different_dport(struct mptcp_sock *msk, const struct socvoid __mptcp_sync_state (struct sock *sk,int state) { +struct mptcp_subflow_context *subflow;struct mptcp_sock *msk =mptcp_sk (sk); +struct sock *ssk = msk->first; -__mptcp_propagate_sndbuf (sk, msk->first); + subflow =mptcp_subflow_ctx (ssk); +__mptcp_propagate_sndbuf (sk, ssk);if (!msk->rcvspace_init) -mptcp_rcv_space_init (msk, msk->first); +mptcp_rcv_space_init (msk, ssk); +if (sk->sk_state ==TCP_SYN_SENT ) { +/* subflow->idsn is always available is TCP_SYN_SENT state, +* even for the FASTOPEN scenarios +*/ +WRITE_ONCE (msk->write_seq, subflow->idsn +1 ); +WRITE_ONCE (msk->snd_nxt, msk->write_seq);mptcp_set_state (sk, state); sk->sk_state_change (sk); }