Article View: linux.kernel.netdev
Article #27525Re: [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 22:04
Date: Sat, 05 Dec 2026 22:04
62 lines
10395 bytes
10395 bytes
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
Technical Details
Message-ID:
<179650825092.3148.6699175124212588959@kernel.org>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378155-linux-kernel-netdev=dewy.ruReferences:
<20261204-net-next-mptcp-misc-feat-7-5-v1-5-1449de51adae@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378155-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio Date: Sat, 05 Dec 2026 22:04:10 +0000 Organization: Usenet Network Message-ID: <179650825092.3148.6699175124212588959@kernel.org> References: <20261204-net-next-mptcp-misc-feat-7-5-v1-5-1449de51adae@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3129559"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4DcC2pbIuE8J/d892tUG+Z80DOU= sha256:hrmsOZrofJf3xPYhZbUVHW6i7mJk0BGEWtKkDymFX2s= sha1:idscWJF+ECOYIEbBrN7ghPYEdAw= sha256:yrukHehVM1ATlkXX+fxC3T0AM97O2Z9odpejww8pjAY= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5DAAC117ED7; Sun, 6 Dec 2026 01:04:28 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.539 X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Baw6wI6swCX9; Sun, 6 Dec 2026 01:04:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378155-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 22EA8117ED3; Sun, 6 Dec 2026 01:04:15 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 6FC492EB0B; Sat, 5 Dec 2026 22:04:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796508253; b=OHACyBZUAngw6tOHeydg+zEJXrjd36EUwotkk119Obv47wApzfP+DBXz6uMS/beHinAo cLSi8n47qQKGxKloTmpj/4dok2TWzUZvg49cPfR8jM42Bdry7kJUUy/xOTvUCdeAtfHzQ IkUazJDMdiWvJmad2al3CWJRm/bo52GAUBU6oRz44/yLTAtEultChtilmobCIYF1W4D5J 6XkLms29nlE7wPoAqg6SOjKh27/FY7t7sSrVdHHz6BBoStFrVXuKz87S8glXneMTWwV/x d6Y+MY+k/VwMZIclKR8fOiPD+nPAI5jLSCiWA2kh/izFeSZ7pJzCz7lFHKn/0OGJJPA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796508253; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=ZfQNpR/XERKnUQmc5sf+1W3TBOHJkOw/cT1oj/VNFR4=; b=ELAuySEQGT3V2msJPIN1SfftCJ4cEYYM8Vz4/vtvLwlLgm58Dfg+cqMkygpvEvsJm3Yn fsL1Z153uAt0sx0D7IdE4/VVejsxv4tRtYuZ1UFiEutHJPE66U06ifQIExmMA3ec5ynGj yT9AxrNJtuufhSXlXPx0qkcHyOenlISS6QNKtZ4oikMKaWaAX8z9XHJ07NUIY9tQ7I8xx EVAWthLmGoDZuVwXNBKxY/RAqKkQALxdyzWcxvsHKfjCKA99X1KA2vLfuTKjnooQ4eORI M7I+SDbJs1pLCVQihfsIhfyaTV/1qNUjNDkbXHfnp642K50kRrLMUvIHq+I8PwdRSZg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gEz0gYt9; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48CE8606A337; Sat, 5 Dec 2026 22:04:13 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gEz0gYt9 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796508252; b=uVyHJa8fGIVdMEmxC5o6tS/NfJv0UePU8pV2on6c2u4ORbK6VZsiq3hY8gxLW8EIjUAb hfQz32hk0w6+USaGDI6s4cmdvqxvBKwNYpRIM4WUCmpm9bdloYGiZIIM1uKrJFeGMXGiv uOKYlkxFF7IhnA6+VZI9x4J40o9MGylc4WGXqVT3xOmFvwsRTWrcOsDKi4wLKN6rEeQvR FMNB7LQ+MBL7/HDtooOksXLyDzFWDZHjUWZY7+OK6uedBbx9JTseOeZcYKGYqjvJG3o/Z oQn2kQRvpYddAEFoPrXPtksmdRElJb3Y+vyj/D07d4/tNXSVjyo+bQA+RGf0VKL6cjw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796508252; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ZfQNpR/XERKnUQmc5sf+1W3TBOHJkOw/cT1oj/VNFR4=; b=SSkG6+VIa5sRbEwOTtljZs5pxW8iXar8DhJ3RycYxKBroDtCSMx1+Qn/YlLnn5BWhjDC gnCXjaSuBLMSPV5+vcvlxOTMwFlQlH/b3AYimGXZ4cwFxaNF2D5f4HBJtawfgD3ZxZiDz VNUE4mrgh1EDWFWSQbsvKAbxrFcIHWbc/8wkWXqwJ7YEYHARfKt9tER00DyG2ymgUghs4 3eIhwkKZCYM9iSSJWRWuPwg9LnKILK5Ky5FOa0tc1A1XDdErBVT9evj4iRmhV2/jdKjg4 Px66Vv5DdSHT1PMjRto6casg6c8JaTNNKFXMcl1rDu7wGFFx2eDSyTnNa+6aiGZ+oUg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gEz0gYt9; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 691E3606A31F; Sat, 5 Dec 2026 22:04:12 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AC541F00A07; Sat, 5 Dec 2026 22:04:11 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796508252; bh=ZfQNpR/XERKnUQmc5sf+1W3TBOHJkOw/cT1oj/VNFR4=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=gEz0gYt9GTr/lvG72h2YEnxzAacBjQd6elGHpkCZHEjLw2ajoytoiopVHYz5JCpqL C+9cxLpPJ9bUJnPyLsMoNJBlSjnv/usS88YQgyL0E0N1kQ0/H8YNqrE2CjnBZjJo+c zP/zzjB5slRZ5NYQ+NPrnj9Qtr7/I4Su73N/NccQqCUXuhdp6C/1kkyki+8Bd6fhwf 3ik0wDRB4F7sDCD8129eztPuw/iMx6+YtE5DXzSDSgs6nEVtOxAzjCnYWB+tXaEdZI jCALcYW//wCLbNnf0RMv3v60S6nspqGdFiYX37kgk1qBX7rURC99qz83kZ8Ryr4aS+ HmIt8n7zxxkSA== X-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 X-In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-5-1449de51adae@kernel.org> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list