From: netdev-bot+sashiko@kernel.org
To: geliang@kernel.org
Cc: mptcp@lists.linux.dev, kuba@kernel.org
Subject: Re: [PATCH mptcp-net v3 2/4] mptcp: add missing memory barriers for rcv_data_fin_seq
Date: Tue, 24 Nov 2026 15:26:33 +0000 [thread overview]
Message-ID: <179553399369.3133.11820722476737181809@kernel.org> (raw)
In-Reply-To: <da8ae9e6c48df602b08475d151a87841ad632400.1795396910.git.tanggeliang@kylinos.cn>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The From: and Signed-off-by: addresses do not match.
- [Low] The commit message says a stale rcv_data_fin_seq can make
mptcp_check_data_fin() 'skip [the DATA_FIN] entirely'.
--
mptcp: add missing memory barriers for rcv_data_fin_seq
This patch adds an smp_wmb() in mptcp_update_rcv_data_fin() between the
writes to rcv_data_fin_seq and rcv_data_fin. It also adds a matching
smp_rmb() in mptcp_pending_data_fin() between the two reads. The goal is
to stop a reader on a weakly-ordered architecture from seeing
rcv_data_fin == 1 together with a stale rcv_data_fin_seq.
> mptcp_pending_data_fin() checks rcv_data_fin and then reads
> rcv_data_fin_seq, but has no read barrier. On weakly-ordered
> architectures, the reader could observe rcv_data_fin == 1 with a
> stale (or zero) rcv_data_fin_seq, causing mptcp_check_data_fin()
> to either process the DATA_FIN prematurely or skip it entirely.
[Severity: Low]
Is "skip it entirely" accurate here?
Suppose the stale rcv_data_fin_seq makes the !before64() check fail.
mptcp_pending_data_fin() then returns false and msk->rcv_data_fin stays
set. The flag is only cleared in the success branch of
mptcp_check_data_fin():
net/mptcp/protocol.c:mptcp_check_data_fin() {
...
if (mptcp_pending_data_fin(sk, &rcv_data_fin_seq)) {
WRITE_ONCE(msk->ack_seq, msk->ack_seq + 1);
WRITE_ONCE(msk->rcv_data_fin, 0);
...
}
Each writer path also triggers a later re-check after rcv_data_fin is
set. For example, get_mapping_status() does this:
if (updated)
mptcp_schedule_work((struct sock *)msk);
The pure DATA_FIN path in options.c and the fallback path in subflow.c
also call mptcp_schedule_work() after a successful
mptcp_update_rcv_data_fin(). A DATA_FIN carried inside a data mapping is
re-checked by move_skbs_to_msk() through mptcp_pending_data_fin(sk, NULL).
So the failing case only seems to delay the DATA_FIN. The harmful case is
the premature one: a stale seq that passes !before64() bumps ack_seq and
sets RCV_SHUTDOWN while data is still pending.
Could the commit message describe the impact that way, so backporters can
judge the severity correctly?
> Fixes: 3721b9b64676 ("mptcp: Track received DATA_FIN sequence number and add related helpers")
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
[Severity: Low]
This isn't a bug, but the author address (geliang@kernel.org) does not
match the only Signed-off-by address (tanggeliang@kylinos.cn).
checkpatch.pl will report FROM_SIGN_OFF_MISMATCH for this.
The other patches in the series have the same mismatch:
mptcp: handle ack_seq advancing past rcv_data_fin_seq
mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint
mptcp: add mptcp_inq() for SIOCINQ
Could the author address be changed, or a Signed-off-by from
geliang@kernel.org be added?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1795396910.git.tanggeliang%40kylinos.cn
next prev parent reply other threads:[~2026-11-24 15:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 1:27 [PATCH mptcp-net v3 0/4] mptcp: fixes for SIOCINQ Geliang Tang
2026-11-23 1:27 ` [PATCH mptcp-net v3 1/4] mptcp: handle ack_seq advancing past rcv_data_fin_seq Geliang Tang
2026-11-24 15:26 ` netdev-bot+sashiko
2026-11-23 1:27 ` [PATCH mptcp-net v3 2/4] mptcp: add missing memory barriers for rcv_data_fin_seq Geliang Tang
2026-11-24 15:26 ` netdev-bot+sashiko [this message]
2026-11-23 1:27 ` [PATCH mptcp-net v3 3/4] mptcp: fix TFO SIOCINQ overflow in mptcp_inq_hint Geliang Tang
2026-11-24 15:26 ` netdev-bot+sashiko
2026-11-23 1:27 ` [PATCH mptcp-net v3 4/4] mptcp: add mptcp_inq() for SIOCINQ Geliang Tang
2026-11-24 15:26 ` netdev-bot+sashiko
2026-11-23 3:34 ` [PATCH mptcp-net v3 0/4] mptcp: fixes " 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=179553399369.3133.11820722476737181809@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=geliang@kernel.org \
--cc=kuba@kernel.org \
--cc=mptcp@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.