All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	willemb@google.com, horms@kernel.org, liyonglong@chinatelecom.cn,
	shuah@kernel.org, fw@strlen.de, netdev@vger.kernel.org,
	mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio
Date: Sat, 05 Dec 2026 22:04:10 +0000	[thread overview]
Message-ID: <179650825092.3148.6699175124212588959@kernel.org> (raw)
In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-5-1449de51adae@kernel.org>

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 Fixes: tag names d2000361e4dd ("mptcp: better mptcp-level RTT
  estimator"), but lockless access to msk->scaling_ratio started…

--

mptcp: annotate lockless access to msk->scaling_ratio

This patch adds READ_ONCE()/WRITE_ONCE() annotations to msk->scaling_ratio.
The writer is mptcp_rcv_rtt_update(), which runs in BH. The readers are
mptcp_win_from_space(), mptcp_space_from_win() and the mptcp_rcvbuf_grow
tracepoint. The race was reported by KCSAN between mptcp_cleanup_rbuf()
and mptcp_data_ready().

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/634

> Fixes: d2000361e4dd ("mptcp: better mptcp-level RTT estimator")

[Severity: Low]
Should this tag point to b8dc6d6ce931 ("mptcp: fix rcv buffer auto-tuning")
instead, or in addition?

That 2023 commit added the u8 msk->scaling_ratio field and the
mptcp_win_from_space() helper, which reads the field with a plain load:

net/mptcp/protocol.h:mptcp_win_from_space() {
	return __tcp_win_from_space(mptcp_sk(sk)->scaling_ratio, space);
}

It also made mptcp_space() in net/mptcp/subflow.c read the field through
that helper:

	*space = __mptcp_space(sk);
	*full_space = mptcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf));

mptcp_space() is called from __tcp_select_window() on the subflow. It runs
under the subflow lock or in subflow BH, for example when an ACK is sent on
receive. It does not run under msk ownership.

The writer added in that commit lived in mptcp_rcv_space_adjust(), which
runs in process context with the msk owned:

	msk->scaling_ratio = scaling_ratio;

So the subflow-side reader and the msk-side writer were never serialized,
even before d2000361e4dd. That later commit moved the writer into BH via
mptcp_rcv_rtt_update(). It also exposed a second reader,
mptcp_cleanup_rbuf(), which is the one in the KCSAN splat.

With the current tag, stable trees that carry b8dc6d6ce931 but not
d2000361e4dd, such as 6.6.y and 6.12.y, would not pick this up. Those
trees would also need the annotation on the older writer in
mptcp_rcv_space_adjust() rather than in mptcp_rcv_rtt_update().

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae%40kernel.org

  reply	other threads:[~2026-12-05 22:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 21:44 [PATCH net-next 00/10] mptcp: misc improvements for v7.5 Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 01/10] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-12-05 21:45   ` sashiko-bot
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko [this message]
2026-12-04 21:44 ` [PATCH net-next 06/10] selftests: mptcp: join: dump stats with right title Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 08/10] selftests: mptcp: sockopt: drop unreachable FIN accounting Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 09/10] mptcp: add msk_is_mptcp() helper Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 10/10] selftests: mptcp: print stats before socket closure Matthieu Baerts (NGI0)

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=179650825092.3148.6699175124212588959@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fw@strlen.de \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liyonglong@chinatelecom.cn \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    /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.