From: sashiko-bot@kernel.org
To: "Geliang Tang" <geliang@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v6 4/7] mptcp: sync mptcp skb cb layout with tcp one
Date: Sun, 23 Aug 2026 01:15:13 +0000 [thread overview]
Message-ID: <20260823011513.CE1BF1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <a853bdf73cee05be30ba12f51cfaa3897d56930f.1787446274.git.tanggeliang@kylinos.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Torn read/write of 64-bit `msk->ack_seq` on 32-bit architectures, leading to corrupted MPTCP Data ACKs.
--
--- Patch [4]: [PATCH mptcp-next v6 4/7] mptcp: sync mptcp skb cb layout with tcp one ---
commit d6240ab2e98090a0998cc27a5a2729d562ab8ffd
Author: Paolo Abeni <pabeni@redhat.com>
mptcp: sync mptcp skb cb layout with tcp one
This commit limits the MPTCP-level sequence number to 32 bits after
validating against the receive window. This allows the MPTCP CB layout
to align with TCP-level fields inside the control buffer, and adds
build time checks to enforce this invariant.
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 0700cdab7f2ed..2e0e8e85b4d0f 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
[ ... ]
> @@ -892,40 +899,40 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk)
> {
[ ... ]
> - msk->bytes_received += end_seq - msk->ack_seq;
> - WRITE_ONCE(msk->ack_seq, end_seq);
> + msk->bytes_received += seq_delta;
> + WRITE_ONCE(msk->ack_seq, msk->ack_seq + seq_delta);
> moved = true;
> }
> return moved;
[Severity: High]
This is a pre-existing issue, but can this lead to torn reads on 32-bit
architectures?
Because msk->ack_seq is a 64-bit value, updating it with WRITE_ONCE() in
process context here (and similarly in __mptcp_move_skb()) without holding
mptcp_data_lock(msk) might race with concurrent softirq readers.
If incoming subflow packets are processed on another CPU, they generate
TCP ACKs via:
tcp_transmit_skb()
mptcp_established_options()
ack_seq = READ_ONCE(msk->ack_seq);
Since this read only holds the subflow lock (bh_lock_sock(ssk)) and not the
parent MPTCP socket lock, a concurrent 64-bit WRITE_ONCE() on 32-bit systems
compiles into a non-atomic dual 32-bit memory access.
Could this torn read result in sending a corrupted MPTCP Data ACK to the
peer? If the sequence number jumps forward or backward unexpectedly, might
the peer incorrectly assume data was successfully received or have its
connection state disrupted?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787446274.git.tanggeliang@kylinos.cn?part=4
next prev parent reply other threads:[~2026-08-23 1:15 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
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 [this message]
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=20260823011513.CE1BF1F000E9@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;
as well as URLs for NNTP newsgroup(s).