All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH 5.10.y 3/3] mptcp: close race between scheduler and state change
Date: Sat, 19 Sep 2026 20:53:50 +0000	[thread overview]
Message-ID: <20260919205350.956551F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919204002.2106015-8-matttbe@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] mptcp: skipped timer reset when mss_now is 0 leads to connection stall
- [High] mptcp: allow_infinite_fallback state corruption when mss_now is 0
--

commit 4c31a1df5ba815467dd012d7f0c9b7bc2457aca9
Author: Paolo Abeni <pabeni@redhat.com>

mptcp: close race between scheduler and state change

This commit adds a check for mss_now being 0 to prevent a divide by zero
operation when selecting a subflow socket. It modifies mptcp_sendmsg and
mptcp_worker to only trigger tcp_push if both copied and mss_now are non-zero.

Link: https://patch.msgid.link/20260917-net-mptcp-misc-fixes-7-3-rc4-v2-2-0cf5c72667c8@kernel.org

> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 292c21713eb7f..fdebc451e23aa 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -1381,7 +1381,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
>  	}
>  
>  	mptcp_set_timeout(sk, ssk);
> -	if (copied) {
> +	if (copied && mss_now) {
>  		tcp_push(ssk, msg->msg_flags, mss_now, tcp_sk(ssk)->nonagle,
>  			 size_goal);
>  
>  		/* start the timer, if it's not pending */
>  		if (!mptcp_timer_pending(sk))
>  			mptcp_reset_timer(sk);
>  	}

[Severity: High]
Does this unintentionally skip resetting the retransmit timer when mss_now
is 0?

If multiple fragments are sent and a subsequent fragment fails, it can leave
copied > 0 but mss_now == 0. By bundling the timer initialization with the
mss_now check, this might prevent data queued to the MPTCP socket from being
retransmitted if the current subflow fails, potentially stalling the
connection.

[ ... ]

> @@ -1891,7 +1891,7 @@ static void mptcp_worker(struct work_struct *work)
>  		if (!mptcp_ext_cache_refill(msk))
>  			break;
>  	}
> -	if (copied) {
> +	if (copied && mss_now) {
>  		tcp_push(ssk, msg.msg_flags, mss_now, tcp_sk(ssk)->nonagle,
>  			 size_goal);
>  		WRITE_ONCE(msk->allow_infinite_fallback, false);
>  	}

[Severity: High]
Could skipping this block when mss_now is 0 cause allow_infinite_fallback
state corruption?

In mptcp_worker(), if a subflow failure occurs during retransmission causing
mss_now == 0, copied might still be > 0. Skipping the update to
msk->allow_infinite_fallback could leave it as true even after MPTCP data
was successfully queued. A subsequent error might then trigger an invalid
fallback to plain TCP, corrupting the connection state and stream data.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260919204002.2106015-5-matttbe@kernel.org?part=3

  reply	other threads:[~2026-09-19 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 20:40 [PATCH 5.10.y 0/3] mptcp: fix recent failed backports (20260919) Matthieu Baerts (NGI0)
2026-09-19 20:40 ` [PATCH 5.10.y 1/3] mptcp: hold mptcp socket before calling tcp_done Matthieu Baerts (NGI0)
2026-09-20  7:36   ` Patch "mptcp: hold mptcp socket before calling tcp_done" has been added to the 5.10-stable tree gregkh
2026-09-19 20:40 ` [PATCH 5.10.y 2/3] mptcp: avoid unneeded actions on subflow reset Matthieu Baerts (NGI0)
2026-09-20  7:36   ` Patch "mptcp: avoid unneeded actions on subflow reset" has been added to the 5.10-stable tree gregkh
2026-09-19 20:40 ` [PATCH 5.10.y 3/3] mptcp: close race between scheduler and state change Matthieu Baerts (NGI0)
2026-09-19 20:53   ` sashiko-bot [this message]
2026-09-20  7:36   ` Patch "mptcp: close race between scheduler and state change" has been added to the 5.10-stable tree gregkh

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=20260919205350.956551F000FF@smtp.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.