Article View: linux.kernel.netdev
Article #26586Re: [PATCH net 3/9] mptcp: limit an orphan probing a zero window
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 21:51
Date: Thu, 03 Dec 2026 21:51
227 lines
16072 bytes
16072 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 2 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] mptcp_orphan_keep() keeps the orphan as long as any active
subflow has a fresh rcv_tstamp and mptcp_subflow_probe_timed_out()…
- [Medium] In mptcp_subflow_probe_timed_out() (net/mptcp/protocol.c), the
data-in-flight branch decides only on `!tp->snd_wnd && icsk->icsk_rto…
- [Medium] The orphan keep logic (mptcp_orphan_keep() plus
mptcp_subflow_probe_timed_out() in net/mptcp/protocol.c) only looks at…
--
mptcp: limit an orphan probing a zero window
This patch adds mptcp_subflow_probe_timed_out(). It checks whether TCP
would have aborted a subflow if that subflow were an orphan probing a
zero window. mptcp_orphan_keep() now uses it, so a peer that keeps its
window closed can no longer hold an MPTCP orphan forever.
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 82a0cbe38192e..96b3baef341f3 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2814,6 +2814,32 @@ static bool mptcp_close_tout_expired(const struct sock *sk)
> inet_csk(sk)->icsk_mtup.probe_timestamp + mptcp_close_timeout(sk));
> }
>
> +/* Would TCP abort this subflow if it were an orphan probing a zero window? */
> +static bool mptcp_subflow_probe_timed_out(struct sock *ssk)
> +{
[ ... ]
> + slow = lock_sock_fast_nested(ssk);
> + limit = tcp_rto_max(ssk);
> + if (tp->packets_out) {
> + ret = !tp->snd_wnd && icsk->icsk_rto >= limit;
[Severity: Medium]
Can icsk_rto ever reach tcp_rto_max() here when
net.ipv4.tcp_thin_linear_timeouts=1?
Take a subflow with fewer than 4 packets in flight whose peer has shrunk
its window to zero. The subflow is not SOCK_DEAD, so
tcp_retransmit_timer() takes the zero-window branch. It jumps to
out_reset_timer without calling tcp_update_rto_stats():
net/ipv4/tcp_timer.c:tcp_retransmit_timer() {
...
if (!tp->snd_wnd && !sock_flag(sk, SOCK_DEAD) &&
!((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV))) {
...
tcp_enter_loss(sk);
tcp_retransmit_skb(sk, skb, 1);
__sk_dst_reset(sk);
goto out_reset_timer;
}
...
out_reset_timer:
...
if (sk->sk_state == TCP_ESTABLISHED &&
(tp->thin_lto || READ_ONCE(net->ipv4.sysctl_tcp_thin_linear_timeouts)) &&
tcp_stream_is_thin(tp) &&
icsk->icsk_retransmits <= TCP_THIN_LINEAR_RETRIES) {
icsk->icsk_backoff = 0;
icsk->icsk_rto = clamp(__tcp_set_rto(tp),
tcp_rto_min(sk),
tcp_rto_max(sk));
...
}
Because icsk_retransmits stays at 0, the thin-stream branch runs every
time the timer fires. It recomputes icsk_rto from srtt/rttvar, so this
check never returns true.
The peer's dup ACKs keep rcv_tstamp fresh, so
tcp_rtx_probe0_timed_out() does not abort the subflow either. As a
result, mptcp_worker() keeps re-arming the close timeout through
mptcp_start_tout_timer().
A plain TCP orphan in the same state is SOCK_DEAD, so it skips that
branch, goes through tcp_write_timeout(), and is aborted.
The commit message says this case is covered ("Same with data in
flight, when the peer has shrunk its window to zero"). This setting is
not one of the corner cases it lists.
Only the per-netns sysctl can trigger this, because
TCP_THIN_LINEAR_TIMEOUTS cannot be set on an MPTCP socket. The only
bound is the global tcp_check_oom() limit added later in the series by
"mptcp: count orphans as TCP does".
> + } else {
> + if (icsk->icsk_backoff < retries2)
> + limit *= 2;
> + /* a shift of 32 already exceeds the limit */
> + when = (u64)icsk->icsk_rto << min_t(u8, icsk->icsk_backoff, 32);
> + ret = tcp_send_head(ssk) && when >= limit;
[Severity: High]
For an idle subflow with packets_out == 0 and no send head, this always
returns false. With default settings, could a remote peer use a second,
idle backup subflow to keep the orphan forever?
The sequence would be:
1. The peer opens a second subflow B with MP_JOIN and sets the backup
bit, which subflow_check_req() copies into subflow->backup. The peer
could also mark B as backup later with MP_PRIO.
2. The peer keeps its window at zero, so the zero-window probe sits on
subflow A. With this patch, A is eventually reported as timed out.
3. The peer sends a pure in-window ACK on B more often than every 240s,
so tcp_ack() keeps B's rcv_tstamp fresh.
B never gets any data:
- mptcp_subflow_get_send() does not pick a backup subflow while A is
active.
- There is no rtx head, since snd_una == snd_nxt.
- mptcp_subflow_get_retrans() only returns a backup when
min_stale_count > 1.
Stale detection does not help either. mptcp_pm_chk_stale() skips B:
net/mptcp/pm.c:mptcp_pm_chk_stale() {
...
/* No data outstanding at TCP level? not stale */
if (tcp_rtx_and_write_queues_empty(ssk))
continue;
...
}
A is never marked stale because its rcv_tstamp keeps changing.
mptcp_orphan_keep() then returns true through B every time the close
timeout expires, and mptcp_worker() re-arms the timer.
The commit message says:
an idle subflow refreshed by keepalives still keeps the orphan
when the stale detection is disabled
Is that accurate, given that this case needs no non-default setting?
A non-backup idle subflow does not stay idle, because
__mptcp_push_pending() would queue a probe on it. The backup bit is what
keeps B idle.
This is still present at the end of the series. Only the
tcp_check_oom() limit from "mptcp: count orphans as TCP does" bounds it.
Would it make sense to count only subflows that hold data, or to track
MPTCP-level progress instead?
> + }
> + unlock_sock_fast(ssk, slow);
> +
> + return ret;
> +}
[ ... ]
> @@ -2829,7 +2855,8 @@ static bool mptcp_orphan_keep(struct sock *sk)
> /* a live peer acks at least the probes, every TCP_RTO_MAX */
> if (__mptcp_subflow_active(subflow) &&
> tcp_jiffies32 - READ_ONCE(tcp_sk(ssk)->rcv_tstamp) <
> - 2 * TCP_RTO_MAX)
> + 2 * TCP_RTO_MAX &&
> + !mptcp_subflow_probe_timed_out(ssk))
> return true;
> }
[Severity: Medium]
Should this also check MPTCP-level progress? The keep decision only
looks at TCP-level subflow state: rcv_tstamp, packets_out, snd_wnd,
icsk_rto, icsk_backoff and the send head. Nothing checks whether
msk->snd_una has advanced.
A peer could advertise a non-zero TCP window, TCP-ACK every segment,
and never advance DATA_ACK.
ack_update_msk() only moves wnd_end forward, so the msk stops sending
new data once snd_nxt reaches wnd_end. mptcp_sendmsg_frag() then sends
no zero-window probe because snd_una != snd_nxt. At the same time,
snd_nxt != write_seq still holds.
__mptcp_retrans() has no retry limit and always ends with:
reset_timer:
mptcp_check_and_set_pending(sk);
if (!mptcp_rtx_timer_pending(sk))
mptcp_reset_rtx_timer(sk);
The dfrag therefore keeps being retransmitted on a subflow with empty
TCP queues. The peer TCP-ACKs it, so rcv_tstamp stays fresh.
Both branches of mptcp_subflow_probe_timed_out() then return false:
- With packets_out set, snd_wnd is non-zero.
- Without packets_out, there is no send head.
Wouldn't mptcp_orphan_keep() then return true every time the close
timeout expires? That would pin the orphan forever, with a single
subflow and default settings.
This needs a misbehaving peer that withholds DATA_ACK while still
sending TCP ACKs. A Linux peer that stops reading advances DATA_ACK and
closes its window instead.
The keep logic came from the previous commit, "mptcp: keep an orphan
while it can send its data". The only limit is the global
tcp_check_oom() bound added later in the series.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17%40kernel.org
Technical Details
Message-ID:
<179633471049.3146.15947480918525815086@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376884-linux-kernel-netdev=dewy.ruReferences:
<20261202-net-mptcp-misc-fixes-7-4-rc7-v1-3-9f03efcb1a17@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376884-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 3/9] mptcp: limit an orphan probing a zero window Date: Thu, 03 Dec 2026 21:51:50 +0000 Organization: Usenet Network Message-ID: <179633471049.3146.15947480918525815086@kernel.org> References: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-3-9f03efcb1a17@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2605885"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:aS9wrAz9IdrJOzxDTwYNcefns1Y= sha256:2hDKp2T6bEJifpg1LuL6B+UscGRU1sb25nf+eWNIN8U= sha1:NAr0kiU9KZMYuTbUVGJ+4cjvvQo= sha256:6BWfFhT9POpEWZDl7vhnG5kVmltvAOhvsvymqlQ+Jus= 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 0E85C117A43; Fri, 4 Dec 2026 00:52:09 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.74 X-Spam-Status: No, score=-3.74 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.24, 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] 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 8MnCl9oK_e2l; Fri, 4 Dec 2026 00:52:06 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376884-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id DBFE81179E7; Fri, 4 Dec 2026 00:51:57 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 36D9B6018D6; Thu, 3 Dec 2026 21:51:57 +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=1796334713; b=GgiwQE+ieoq7knhLc7cA6xEfY6Huphs6mAFD5gHjSJ705syj6FXSzFqofSkp+hf1sIJG AxKEOEHr0Zj8P5iT7uyJgFUooClVRrgfeEScN4Nmakma48R4aWSUWUBFRjwopSBXWZnYd QOBaDCiZX0gw4IKPdCYHNLjdqZRPhxFXEj5OACiHr1URMzCulWQmnqydBhg10WZPhP49K i3ZnxYpBxfQ0xDsvc0k+8wtXUiYtc6B/1deNO3noEi4ZdAVDksiJWBzNBT3ESv45bXa4A totNkEZMhxwjTazfJlA6N1OdS0BRMrNoJMMIk7ETHKjUjDo/Ed6vfF6F8LPOkEnS3hg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796334713; 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=Q2Exe6TuJDM84IK9EGyN85jWXFkFhrYOg/etIqpqWsA=; b=aWsfto87ZmdUgDqMeU2NYba7VCGRDzCgmIkyK9cY+Wq5HOVwD9fL+NG3wNFQfLd7lGsf C4L/cWfR4tddbEyQeGc6zNvK3uqxZeIRPsvSRbHScSwswjD1Xr3rKdSwUotFmM5x6deug WB0TaPmVxUwcXsHjIFCmWS1MkHWaD9aLmB/XbKa+Dh1yQRq8xuwiC8ajUsltTwroiC1hB q4iZG2ZBRV8XbNAlj34+FCZCquu4hxsNCOU1ydhnrhSs5ogfU1BvfPjXyep1/YWXjYBu6 BsS2gd3AgReCqgHG1vEKkBk0hGO5NV7L7a0o1CRQLSjyfOreA0Uwye+1O+6yFax746Q== 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=l8+Irv6K; 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 0128E606A684; Thu, 3 Dec 2026 21:51:53 +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=l8+Irv6K 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=1796334712; b=ugIm16dlqpXF/C8NSDnl0CzkWTmy2xVMInEkv5mucT/gUAYY3ly2vJfjaofA78Pg5Rny woZPw60hUCE7qwf8byHqWpxuDvlnB89NcnRoo6n2cp5u2hqRU+1r3QHv/RMVjB8XYsctm rWqaLdfhcfsPqhCJr4uIgZ+b6dRXcnhEflN9SnIyBJqOHeusvUrpYmxLset0H2E8dlaTW +CEZ1KeDBuUqTA2xACh8pzVzrJqvWAdSwCzwh2Lx/Hxd/t12ofGijoUGvJJCBP6XGw7v8 6JC9c7deQC4GRwwT/i5m98ERK9ZZxt+YCgGyucBK7PHH0XX35ZEj/XBXG6VLx/mHQ4A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796334712; 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=Q2Exe6TuJDM84IK9EGyN85jWXFkFhrYOg/etIqpqWsA=; b=zsRmzC18Bww1tjwp4v6lwxI5nJRmJ0PBHELwDcNKYs/S/THlnEiIMVP+iQj0hPGXiq/z SZfPtwMXRNaaQkmhZpYUnyxWAhoEPFhhzvItuQ86BJHznTc3mz2IEx5QB6gCrerOtE+u8 WND8CNssgN2FZxX5CdBVNdJCTEELg0N9XWAxhoGnIyCF8wSeyULWVIzSRpNECiydaFw4y Kfaq5BOLMu45fLDfTfh8MDYJIs72/BGGcQDMpv9u3aICQe0F50l+9cRVcxH9wGgoW8QVH /xdSHCEMcmr3h0XPsF4Krl2c/asvJc2AlVureoE6rrzuSnTq+rN1Z4Kz2/jApHxsyWQ== 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=l8+Irv6K; 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 1EAB1606A33A; Thu, 3 Dec 2026 21:51:51 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC10B1F000C2; Thu, 3 Dec 2026 21:51:50 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796334711; bh=Q2Exe6TuJDM84IK9EGyN85jWXFkFhrYOg/etIqpqWsA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=l8+Irv6KlB1C/NQhad18E2jGEVbD/saGlLRS/Y84mMTG18uqS4+5VX53NO/QahOou v/KunRN4F1LqjBJHR4StqXB1+USMnSoZtlU65nkL4LEM4qDt4sl30Hbxee2GKd/q1V lb9lCBg4BpvsaBkaYzNmxPwmM5KmxDABW2/gQfTDJjoOkAfoZL7kN6fLH+m4tnpjRj 20tUWYM2F+aFyM4QwcX5tB6PDS1XesuAxMvAx8FUUEFXGjro3TpZZhp2EdIbmUwAhP HYMxRyghdg6VR5zaUZG1+5jH/v0PKkaoBZtF29vU5C1RR/HBEEmeHPojfIabRkCHL8 FBAcZIGN4Lz4Q== 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, dcaratti@redhat.com, netdev@vger.kernel.org, mptcp@lists.linux.dev, mason@kernel.org, stable@vger.kernel.org X-In-Reply-To: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-3-9f03efcb1a17@kernel.org> X-sashiko-severity: High 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