MPTCP Linux Development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Geliang Tang" <geliang@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v6 3/7] mptcp: remove CB offset field
Date: Sun, 23 Aug 2026 01:24:23 +0000	[thread overview]
Message-ID: <20260823012423.7F5E21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <95f5d91022661e9783da7a08c369659b3a14f802.1787446274.git.tanggeliang@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incorrect initialization of `subflow->map_subflow_seq` in `mptcp_propagate_state` completely breaks data reception when falling back to TCP.
--

--- Patch [3]: [PATCH mptcp-next v6 3/7] mptcp: remove CB offset field ---
commit 8a2d837eb49f2826870e0f275e0beb7da32784d7
Author: Paolo Abeni <pabeni@redhat.com>

mptcp: remove CB offset field

This commit replaces the SKB CB offset field with a new socket-level
copied_seq field to track bytes already consumed. Sequence number tracking
is updated to synchronize with IASN, and MPTCP sequence space is initialized
to 0 in fallback mode.

> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index ed3a48cf9c973..6bffa02c69626 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -520,6 +522,13 @@ static void mptcp_propagate_state(struct sock *sk, struct sock *ssk,
>  		WRITE_ONCE(msk->snd_una, subflow->idsn + 1);
>  		WRITE_ONCE(msk->wnd_end, subflow->idsn + 1 + tcp_sk(ssk)->snd_wnd);
>  		subflow_set_remote_key(msk, subflow, mp_opt);
> +	} else {
> +		/* Fallback: initialize sequence space to 0 (no remote key) */
> +		subflow->map_seq = 0;
> +		/* ensure mptcp_subflow_get_map_offset() returns 0 */
> +		subflow->map_subflow_seq = subflow->ssn_offset +
> +					   tcp_sk(ssk)->copied_seq;

[Severity: High]
Does this code incorrectly initialize map_subflow_seq during TCP fallback?

The comment says this should ensure mptcp_subflow_get_map_offset() returns
0, but the offset and copied_seq are added rather than subtracted.

Because mptcp_subflow_get_map_offset() evaluates
copied_seq - ssn_offset - map_subflow_seq, adding the terms here causes the
offset to evaluate to -2 * ISN.

When falling back to standard TCP, this miscalculation will cause incoming
packets to fail sequence bounds checks against msk->ack_seq, resulting in
data reception failures as packets are either dropped or permanently stuck
in the out-of-order queue.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787446274.git.tanggeliang@kylinos.cn?part=3

  reply	other threads:[~2026-08-23  1:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23  1:01 [PATCH mptcp-next v6 0/7] Reduce the differences between TCP and MPTCP for TLS usage Geliang Tang
2026-08-23  1:01 ` [PATCH mptcp-next v6 1/7] mptcp: drop the mptcp_ooo_try_coalesce() helper Geliang Tang
2026-08-23  1:01 ` [PATCH mptcp-next v6 2/7] mptcp: drop the cant_coalesce CB field Geliang Tang
2026-08-23  1:01 ` [PATCH mptcp-next v6 3/7] mptcp: remove CB offset field Geliang Tang
2026-08-23  1:24   ` sashiko-bot [this message]
2026-08-23  1:01 ` [PATCH mptcp-next v6 4/7] mptcp: sync mptcp skb cb layout with tcp one Geliang Tang
2026-08-23  1:15   ` sashiko-bot
2026-08-23  1:01 ` [PATCH mptcp-next v6 5/7] mptcp: defer read_sock cleanup to mptcp_worker Geliang Tang
2026-08-23  1:01 ` [PATCH mptcp-next v6 6/7] mptcp: track app-limited state in mptcp_sendmsg Geliang Tang
2026-08-23  1:01 ` [PATCH mptcp-next v6 7/7] selftests: mptcp: sockopt: check app_limited Geliang Tang
2026-08-23  2:15 ` [PATCH mptcp-next v6 0/7] Reduce the differences between TCP and MPTCP for TLS usage MPTCP CI

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=20260823012423.7F5E21F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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