MPTCP Linux Development
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: gregkh@linuxfoundation.org,kuba@kernel.org,matttbe@kernel.org,mptcp@lists.linux.dev,sashal@kernel.org,yangang@kylinos.cn
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "mptcp: annotate data-races around subflow->fully_established" has been added to the 6.12-stable tree
Date: Sun, 20 Sep 2026 09:36:37 +0200	[thread overview]
Message-ID: <2026092037-islamic-default-0aca@gregkh> (raw)
In-Reply-To: <20260919195642.1977885-8-matttbe@kernel.org>


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

    mptcp: annotate data-races around subflow->fully_established

to the 6.12-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-annotate-data-races-around-subflow-fully_established.patch
and it can be found in the queue-6.12 subdirectory.

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


From stable+bounces-338598-greg=kroah.com@vger.kernel.org Sat Sep 19 21:57:10 2026
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Date: Sat, 19 Sep 2026 21:56:44 +0200
Subject: mptcp: annotate data-races around subflow->fully_established
To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org
Cc: Gang Yan <yangang@kylinos.cn>, sashal@kernel.org, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, Jakub Kicinski <kuba@kernel.org>
Message-ID: <20260919195642.1977885-8-matttbe@kernel.org>

From: Gang Yan <yangang@kylinos.cn>

commit 581c8cbfa934aaa555daa4e843242fcecc160f05 upstream.

We introduce the same handling for potential data races with the
'fully_established' flag in subflow as previously done for
msk->fully_established.

Additionally, we make a crucial change: convert the subflow's
'fully_established' from 'bit_field' to 'bool' type. This is
necessary because methods for avoiding data races don't work well
with 'bit_field'. Specifically, the 'READ_ONCE' needs to know
the size of the variable being accessed, which is not supported in
'bit_field'. Also, 'test_bit' expect the address of 'bit_field'.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/516
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20241021-net-next-mptcp-misc-6-13-v1-2-1ef02746504a@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 2b0f561f21b2 ("mptcp: avoid unneeded actions on subflow reset")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/mptcp/options.c  |    4 ++--
 net/mptcp/protocol.c |    2 +-
 net/mptcp/protocol.h |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -532,7 +532,7 @@ static bool mptcp_established_options_mp
 		return false;
 
 	/* MPC/MPJ needed only on 3rd ack packet, DATA_FIN and TCP shutdown take precedence */
-	if (subflow->fully_established || snd_data_fin_enable ||
+	if (READ_ONCE(subflow->fully_established) || snd_data_fin_enable ||
 	    subflow->snd_isn != TCP_SKB_CB(skb)->seq ||
 	    sk->sk_state != TCP_ESTABLISHED)
 		return false;
@@ -999,7 +999,7 @@ static bool check_fully_established(stru
 	/* here we can process OoO, in-window pkts, only in-sequence 4th ack
 	 * will make the subflow fully established
 	 */
-	if (likely(subflow->fully_established)) {
+	if (likely(READ_ONCE(subflow->fully_established))) {
 		/* on passive sockets, check for 3rd ack retransmission
 		 * note that msk is always set by subflow_syn_recv_sock()
 		 * for mp_join subflows
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3685,7 +3685,7 @@ static void schedule_3rdack_retransmissi
 	struct tcp_sock *tp = tcp_sk(ssk);
 	unsigned long timeout;
 
-	if (mptcp_subflow_ctx(ssk)->fully_established)
+	if (READ_ONCE(mptcp_subflow_ctx(ssk)->fully_established))
 		return;
 
 	/* reschedule with a timeout above RTT, as we must look only for drop */
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -545,7 +545,7 @@ struct mptcp_subflow_context {
 		is_mptfo : 1,	    /* subflow is doing TFO */
 		close_event_done : 1,       /* has done the post-closed part */
 		mpc_drop : 1,	    /* the MPC option has been dropped in a rtx */
-		__unused : 8;
+		__unused : 9;
 	bool	data_avail;
 	bool	scheduled;
 	bool	pm_listener;	    /* a listener managed by the kernel PM? */


Patches currently in stable-queue which might be from matttbe@kernel.org are

queue-6.12/mptcp-annotate-data-races-around-subflow-fully_established.patch
queue-6.12/selftests-mptcp-fix-an-uaf-in-mptcp_connect.c.patch
queue-6.12/mptcp-fix-bad-accounting-in-__mptcp_subflow_push_pending.patch
queue-6.12/mptcp-syncookies-remember-the-request-backup-flag.patch
queue-6.12/mptcp-remove-unneeded-read_once-annotation.patch
queue-6.12/mptcp-close-race-between-scheduler-and-state-change.patch
queue-6.12/tcp-use-gfp_atomic-in-tcp_send_active_reset.patch
queue-6.12/mptcp-avoid-unneeded-actions-on-subflow-reset.patch
queue-6.12/mptcp-options-handle-mpc-data-csum-reqd-no-csum.patch
queue-6.12/mptcp-subflow-no-need-to-copy-thmac-during-ulp_clone.patch

  reply	other threads:[~2026-09-20  7:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 19:56 [PATCH 6.12.y 0/5] mptcp: fix recent failed backports (20260919) Matthieu Baerts (NGI0)
2026-09-19 19:56 ` [PATCH 6.12.y 1/5] mptcp: annotate data-races around subflow->fully_established Matthieu Baerts (NGI0)
2026-09-20  7:36   ` gregkh [this message]
2026-09-20  7:48     ` Patch "mptcp: annotate data-races around subflow->fully_established" has been added to the 6.12-stable tree sashiko-bot
2026-09-20  9:33       ` Matthieu Baerts
2026-09-20 13:10         ` Greg KH
2026-09-20 13:23           ` Matthieu Baerts
2026-09-19 19:56 ` [PATCH 6.12.y 2/5] mptcp: remove unneeded READ_ONCE() annotation Matthieu Baerts (NGI0)
2026-09-19 19:56 ` [PATCH 6.12.y 3/5] mptcp: avoid unneeded actions on subflow reset Matthieu Baerts (NGI0)
2026-09-20  7:36   ` Patch "mptcp: avoid unneeded actions on subflow reset" has been added to the 6.12-stable tree gregkh
2026-09-19 19:56 ` [PATCH 6.12.y 4/5] mptcp: close race between scheduler and state change Matthieu Baerts (NGI0)
2026-09-20  7:36   ` Patch "mptcp: close race between scheduler and state change" has been added to the 6.12-stable tree gregkh
2026-09-19 19:56 ` [PATCH 6.12.y 5/5] mptcp: fix bad accounting in __mptcp_subflow_push_pending() Matthieu Baerts (NGI0)
2026-09-20  7:36   ` Patch "mptcp: fix bad accounting in __mptcp_subflow_push_pending()" has been added to the 6.12-stable tree gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026092037-islamic-default-0aca@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=yangang@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox