MPTCP Linux Development
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: mptcp@lists.linux.dev, kuba@kernel.org
Subject: Re: [PATCH mptcp-net v2 13/62] mptcp: limit an orphan probing a zero window
Date: Mon, 23 Nov 2026 06:32:22 +0000	[thread overview]
Message-ID: <179541554231.3133.10776173874685565@kernel.org> (raw)
In-Reply-To: <20261121-mptcp-cmason-fixes-v2-13-00327fd1de1f@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · 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).

- [Medium] mptcp_subflow_probe_timed_out()
  (net/mptcp/protocol.c:2875-2898) can only report a timeout while the…

--

mptcp: limit an orphan probing a zero window

This patch adds mptcp_subflow_probe_timed_out(). It reports whether TCP
would have aborted a subflow that is probing a zero window, or that has
data in flight after the peer shrank its window to zero. mptcp_orphan_keep()
uses the new helper so that such an orphan is no longer kept once its close
timeout expires.

> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 944c9d11d2116..ff71f19540771 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2871,6 +2871,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;
> +	} 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;
> +	}
> +	unlock_sock_fast(ssk, slow);
> +
> +	return ret;
> +}
> +

[ ... ]

> @@ -2886,7 +2912,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]

Can a remote peer still keep this orphan forever if the subflow is idle
at TCP level?

mptcp_subflow_probe_timed_out() only returns true when the subflow has
data at TCP level. That means either data in flight with a zero snd_wnd,
or a send head. With packets_out == 0 and tcp_send_head() == NULL, ret is
always false.

Consider a peer that TCP-ACKs all subflow data with an open TCP window but
never moves its DATA_ACK. msk->snd_una stays fixed, so the msk fills up to
wnd_end and stops sending. mptcp_sendmsg_frag() then queues no MPTCP zero
window probe:

net/mptcp/protocol.c:mptcp_sendmsg_frag() {
    ...
		if (snd_una != msk->snd_nxt || skb->len ||
		    skb != tcp_send_head(ssk)) {
			tcp_remove_empty_skb(ssk);
			return 0;
		}
    ...
}

The subflow therefore stays idle at TCP level. Reinjections from
__mptcp_retrans() are TCP-ACKed as well, and __mptcp_retrans() never gives
up.

The peer can also pass the "live peer" check cheaply. tcp_ack() refreshes
tp->rcv_tstamp on any non-old ACK, including a pure duplicate ACK. One
segment sent more often than every 2 * TCP_RTO_MAX is enough.

mptcp_worker() then re-arms the close timeout each time it expires:

	if (mptcp_close_tout_expired(sk) && mptcp_orphan_keep(sk)) {
		mptcp_start_tout_timer(sk);
		__mptcp_push_pending(sk, 0);
	}

None of these checks look at progress at the MPTCP level (snd_una or
DATA_ACK).

There is a related case. mptcp_orphan_keep() returns true for the first
subflow that passes the checks. Could an idle MP_JOIN subflow kept fresh
this way keep the orphan alive after the probing subflow has timed out?

Before this series, these orphans were freed when the close timeout
(TCP_TIMEWAIT_LEN) expired. The later patch "mptcp: count orphans as TCP
does" caps the total through tcp_check_oom() (tcp_max_orphans and
tcp_mem[2]). Below those limits, each orphan can still be kept as long as
the peer wants, together with its subflows and queued send data.

The commit message also says:

  Two corner cases needing non-default settings are not covered, which is
  fine: an idle subflow refreshed by keepalives still keeps the orphan
  when the stale detection is disabled, and tcp_orphan_retries is ignored.

Is this accurate? mptcp_pm_chk_stale() in net/mptcp/pm.c skips idle
subflows:

		/* No data outstanding at TCP level? not stale */
		if (tcp_rtx_and_write_queues_empty(ssk))
			continue;

Also, mptcp_orphan_keep() uses __mptcp_subflow_active(), which does not
check subflow->stale. So the idle subflow case seems to happen with default
settings too.

The commit message also says "It is now reset as TCP does, respecting
tcp_retries2." TCP gives up through tcp_write_timeout() when its data is
never acknowledged. Here, MPTCP-level data that is never DATA_ACKed does
not lead to a reset. Should either the check or the commit message be
updated?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121-mptcp-cmason-fixes-v2-0-00327fd1de1f%40kernel.org

  reply	other threads:[~2026-11-23  6:32 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21  9:40 [PATCH mptcp-net v2 00/62] mptcp: misc fixes Matthieu Baerts (NGI0)
2026-11-21  9:40 ` [PATCH mptcp-net v2 01/62] tcp: drain the queues of a listen() that fails Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 02/62] mptcp: " Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 03/62] mptcp: clear inet_opt in the child of an IPv6 listener Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 04/62] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 05/62] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 06/62] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-23 10:22     ` Matthieu Baerts
2026-11-21  9:41 ` [PATCH mptcp-net v2 07/62] mptcp: pm: keep an RM_ADDR when computing the MSS Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 08/62] mptcp: arm the rtx timer if a push leaves data behind Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 09/62] mptcp: force the charge for the first skb of a subflow Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 10/62] mptcp: leave an orphan's DATA_FIN to the worker Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 11/62] mptcp: don't leak an orphan when the PM closes its last subflow Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 12/62] mptcp: keep an orphan while it can send its data Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 13/62] mptcp: limit an orphan probing a zero window Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko [this message]
2026-11-21  9:41 ` [PATCH mptcp-net v2 14/62] mptcp: count orphans as TCP does Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 15/62] mptcp: return EOF after a DATA_FIN, " Matthieu Baerts (NGI0)
2026-11-21 10:25   ` sashiko-bot
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 16/62] mptcp: let TCP send orphan data after fallback Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 17/62] mptcp: reset the subflow on abort " Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 18/62] mptcp: wake up blocked senders when no sf left Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 19/62] mptcp: set SEND_SHUTDOWN on close by an sf error Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 20/62] mptcp: start close timeout on initial sf shutdown Matthieu Baerts (NGI0)
2026-11-21 10:20   ` sashiko-bot
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 21/62] mptcp: process a DATA_FIN received with old data Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 22/62] mptcp: no sf left: process pending MP_FASTCLOSE Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 23/62] mptcp: no sf left: process pending DATA_FIN Matthieu Baerts (NGI0)
2026-11-21 10:17   ` sashiko-bot
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 24/62] mptcp: process pending close events at accept() Matthieu Baerts (NGI0)
2026-11-21 10:13   ` sashiko-bot
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 25/62] mptcp: clear sk_err on connect(), as TCP does Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 26/62] mptcp: clear DEFER_CONNECT on disconnect Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 27/62] mptcp: report sf aborts during deferred connect Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 28/62] mptcp: no fastclose reset from SYN_SENT subflows Matthieu Baerts (NGI0)
2026-11-21 10:11   ` sashiko-bot
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 29/62] mptcp: keep listening after MSG_FASTOPEN errors Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 30/62] mptcp: don't inherit fastopening from a listener Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 31/62] mptcp: drop non-MP_JOIN cookie ACKs on PM listeners Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 32/62] net: add __sk_net_refcnt_upgrade() with a GFP mask Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 33/62] mptcp: pm: don't let listeners pin their netns Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 34/62] mptcp: close a subflow reset for a bad mapping Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 35/62] mptcp: initialize drop_req in subflow_init_req() Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 36/62] mptcp: pm: kernel: count endpoint listeners as sockets in use Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 37/62] mptcp: count a listener once when listen() is called again Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 38/62] mptcp: send the infinite map in a single segment Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 39/62] mptcp: keep room for infinite map after fallback Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 40/62] mptcp: do not fallback while old data is in flight Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 41/62] mptcp: stop resending data to a peer that fell back Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 42/62] mptcp: don't resend data acked without MPTCP opts Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 43/62] mptcp: pm: kernel: don't count signal+subflow ID 0 endp Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 44/62] selftests: mptcp: join: check re-adding " Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 45/62] tcp: do not pass a BPF reqsk to an MPTCP listener Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 46/62] mptcp: reclaim forward memory after coalescing skbs Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 47/62] mptcp: don't charge a shared page twice at accept() Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 48/62] mptcp: don't charge the backlog " Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 49/62] mptcp: don't charge a subflow twice when it joins during accept() Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 50/62] mptcp: continue the last mapping after a fallback Matthieu Baerts (NGI0)
2026-11-23  6:32   ` netdev-bot+sashiko
2026-11-21  9:41 ` [PATCH mptcp-net v2 51/62] mptcp: keep the first byte after a simult connect Matthieu Baerts (NGI0)
2026-11-21 10:31   ` sashiko-bot
2026-11-21  9:41 ` [PATCH mptcp-net v2 52/62] mptcp: move to ESTABLISHED " Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 53/62] mptcp: fix MSG_PEEK after a partly peeked skb Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 54/62] mptcp: send the DATA_ACK after moving the backlog Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 55/62] selftests: mptcp: join: infinite map: no spurious rtx Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 56/62] selftests: mptcp: connect: trunc: wait for acks Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 57/62] mptcp: order write_seq and DATA_FIN flag for fallback Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 58/62] Squash to "bpf: Add mptcp packet scheduler struct_ops" Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 59/62] Squash to "bpf: Export mptcp packet scheduler helpers" Matthieu Baerts (NGI0)
2026-11-21 10:21   ` sashiko-bot
2026-11-21  9:41 ` [PATCH mptcp-next mptcp-net v2 60/62] mptcp: push pending data after a fallback on reception Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-next mptcp-net v2 61/62] mptcp: report errors as TCP does when closing Matthieu Baerts (NGI0)
2026-11-21 10:30   ` sashiko-bot
2026-11-21  9:42 ` [PATCH RFC mptcp-next mptcp-net v2 62/62] mptcp: reset when the DSS disappears after a DATA_ACK Matthieu Baerts (NGI0)
2026-11-21 10:20   ` sashiko-bot
2026-11-21 12:11 ` [PATCH mptcp-net v2 00/62] mptcp: misc fixes MPTCP CI
2026-11-23 11:57 ` Matthieu Baerts

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=179541554231.3133.10776173874685565@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=kuba@kernel.org \
    --cc=matttbe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox