All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	"MPTCP Linux" <mptcp@lists.linux.dev>
Subject: Re: [PATCH RFC mptcp-next mptcp-net v2 62/62] mptcp: reset when the DSS disappears after a DATA_ACK
Date: Sat, 21 Nov 2026 10:20:36 +0000	[thread overview]
Message-ID: <sashiko-outbox-226934@kernel.org> (raw)
In-Reply-To: <20261121-mptcp-cmason-fixes-v2-62-00327fd1de1f@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] mptcp: fallback after dss_confirmed in mptcp_dss_corruption()
  on partial map
- [Low] mptcp: missing MAPPING_INFINITE in show_mapping_status() trace
  macro
--

commit 066a0ac232910122a63844ec66369cf60e694e69
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>

mptcp: reset when the DSS disappears after a DATA_ACK

This commit tracks whether a DATA_ACK has acknowledged sent data on a
subflow (dss_confirmed) and resets the subflow instead of falling back to
TCP when a subsequent segment arrives without a DSS option or with an
invalid mapping.

> diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
> index 7dbad6debdf07..e66d8416fe797 100644
> --- a/net/mptcp/subflow.c
> +++ b/net/mptcp/subflow.c
> @@ -1072,7 +1072,8 @@ enum mapping_status {
>  	MAPPING_DATA_FIN,
>  	MAPPING_DUMMY,
>  	MAPPING_BAD_CSUM,
> -	MAPPING_NODSS
> +	MAPPING_NODSS,
> +	MAPPING_INFINITE
>  };
>  
>  static void dbg_bad_map(struct mptcp_subflow_context *subflow, u32 ssn)
> @@ -1242,7 +1243,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
>  	if (data_len == 0) {
>  		pr_debug("infinite mapping received\n");
>  		MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_INFINITEMAPRX);
> -		return MAPPING_INVALID;
> +		return MAPPING_INFINITE;
>  	}

[Severity: Low]
Should show_mapping_status() in include/trace/events/mptcp.h also be
updated for MAPPING_INFINITE (along with MAPPING_BAD_CSUM and
MAPPING_NODSS) so trace_subflow_check_data_avail() does not print raw
numeric values?

>  
>  	if (mpext->data_fin == 1) {
> @@ -1453,6 +1454,22 @@ static void subflow_update_dsn_base(struct mptcp_subflow_context *subflow)
>  		subflow->dsn_end = end;
>  }
>  
> +/* RFC 8684, 3.7: no fallback once a DATA_ACK acked our data, except MP_FAIL */
> +static bool subflow_nodss_is_fatal(struct mptcp_sock *msk,
> +				   const struct mptcp_subflow_context *subflow)
> +{
> +	bool fatal;
> +
> +	if (!subflow->dss_confirmed)
> +		return false;
> +
> +	/* before a fallback, only an MP_FAIL clears allow_subflows */
> +	spin_lock_bh(&msk->fallback_lock);
> +	fatal = msk->allow_subflows;
> +	spin_unlock_bh(&msk->fallback_lock);
> +	return fatal;
> +}
> +
>  static bool subflow_check_data_avail(struct sock *ssk)
>  {
>  	struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk);
> @@ -1473,7 +1490,9 @@ static bool subflow_check_data_avail(struct sock *ssk)
>  		status = get_mapping_status(ssk, msk);
>  		trace_subflow_check_data_avail(status, skb_peek(&ssk->sk_receive_queue));
>  		if (unlikely(status == MAPPING_INVALID || status == MAPPING_DUMMY ||
> -			     status == MAPPING_BAD_CSUM || status == MAPPING_NODSS))
> +			     status == MAPPING_BAD_CSUM ||
> +			     status == MAPPING_NODSS ||
> +			     status == MAPPING_INFINITE))
>  			goto fallback;
>  
>  		if (status != MAPPING_OK)
> @@ -1523,7 +1542,9 @@ static bool subflow_check_data_avail(struct sock *ssk)
>  			return true;
>  		}
>  
> -		if (!mptcp_try_fallback(ssk, MPTCP_MIB_DSSFALLBACK)) {
> +		if (((status == MAPPING_NODSS || status == MAPPING_INVALID) &&
> +		     subflow_nodss_is_fatal(msk, subflow)) ||
> +		    !mptcp_try_fallback(ssk, MPTCP_MIB_DSSFALLBACK)) {

[Severity: Medium]
Can an incoming skb that starts within the current mapping but extends
beyond subflow->map_data_len (for instance, after middlebox coalescing or
resegmentation across a mapping boundary) still trigger a fallback to TCP
after subflow->dss_confirmed is set?

validate_mapping() in get_mapping_status() only checks that the starting
SSN of the skb lies within [subflow->map_subflow_seq,
subflow->map_subflow_seq + subflow->map_data_len), so get_mapping_status()
returns MAPPING_OK and bypasses subflow_nodss_is_fatal() here.  When
__mptcp_move_skbs_from_subflow() then sees map_remaining < len, it calls
mptcp_dss_corruption(), which invokes mptcp_try_fallback() without
checking whether subflow->dss_confirmed is set:

net/mptcp/protocol.c:mptcp_dss_corruption() {
	if (!mptcp_try_fallback(ssk, MPTCP_MIB_DSSCORRUPTIONFALLBACK)) {
		MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_DSSCORRUPTIONRESET);
		mptcp_subflow_reset(ssk);
	}
}

As a result, the receiver still performs a one-sided fallback to TCP after
a DATA_ACK has confirmed bidirectional MPTCP options instead of resetting
the subflow.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261121-mptcp-cmason-fixes-v2-0-00327fd1de1f@kernel.org?part=62

      reply	other threads:[~2026-11-21 10:20 UTC|newest]

Thread overview: 72+ 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-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-21  9:41 ` [PATCH mptcp-net v2 13/62] mptcp: limit an orphan probing a zero window Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 14/62] mptcp: count orphans as TCP does Matthieu Baerts (NGI0)
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-21  9:41 ` [PATCH mptcp-net v2 16/62] mptcp: let TCP send orphan data after fallback Matthieu Baerts (NGI0)
2026-11-21  9:41 ` [PATCH mptcp-net v2 17/62] mptcp: reset the subflow on abort " Matthieu Baerts (NGI0)
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-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-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-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-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-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-21  9:41 ` [PATCH mptcp-net v2 29/62] mptcp: keep listening after MSG_FASTOPEN errors Matthieu Baerts (NGI0)
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-21  9:41 ` [PATCH mptcp-net v2 39/62] mptcp: keep room for infinite map after fallback Matthieu Baerts (NGI0)
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-21  9:41 ` [PATCH mptcp-net v2 46/62] mptcp: reclaim forward memory after coalescing skbs Matthieu Baerts (NGI0)
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-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 [this message]

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=sashiko-outbox-226934@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=sashiko-reviews@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.