From: Matthieu Baerts <matthieu.baerts@tessares.net>
To: stable@vger.kernel.org, gregkh@linuxfoundation.org,
Sasha Levin <sashal@kernel.org>
Cc: MPTCP Upstream <mptcp@lists.linux.dev>,
Paolo Abeni <pabeni@redhat.com>,
Christoph Paasch <cpaasch@apple.com>,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH 6.1.y] mptcp: do not rely on implicit state check in mptcp_listen()
Date: Fri, 28 Jul 2023 16:59:39 +0200 [thread overview]
Message-ID: <d9fb660d-c45f-e8e4-4995-9dba6de2d1f9@tessares.net> (raw)
In-Reply-To: <20230727141625.2524544-1-matthieu.baerts@tessares.net>
Hi Greg, Sasha,
On 27/07/2023 16:16, Matthieu Baerts wrote:
> From: Paolo Abeni <pabeni@redhat.com>
>
> commit 0226436acf2495cde4b93e7400e5a87305c26054 upstream.
>
> Since the blamed commit, closing the first subflow resets the first
> subflow socket state to SS_UNCONNECTED.
>
> The current mptcp listen implementation relies only on such
> state to prevent touching not-fully-disconnected sockets.
>
> Incoming mptcp fastclose (or paired endpoint removal) unconditionally
> closes the first subflow.
>
> All the above allows an incoming fastclose followed by a listen() call
> to successfully race with a blocking recvmsg(), potentially causing the
> latter to hit a divide by zero bug in cleanup_rbuf/__tcp_select_window().
>
> Address the issue explicitly checking the msk socket state in
> mptcp_listen(). An alternative solution would be moving the first
> subflow socket state update into mptcp_disconnect(), but in the long
> term the first subflow socket should be removed: better avoid relaying
> on it for internal consistency check.
>
> Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation")
> Cc: stable@vger.kernel.org
> Reported-by: Christoph Paasch <cpaasch@apple.com>
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/414
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
> Backport notes:
> - Conflicting with a cleanup that has been done after v6.1, see commit
> cfdcfeed6449 ("mptcp: introduce 'sk' to replace 'sock->sk' in
> mptcp_listen()").
Sasha just backported this commit cfdcfeed6449 ("mptcp: introduce 'sk'
to replace 'sock->sk' in mptcp_listen()") so 0226436acf24 ("mptcp: do
not rely on implicit state check in mptcp_listen()") can be applied
without conflict. Thank you for that, good idea, it works for me!
Please drop this patch here then.
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
prev parent reply other threads:[~2023-07-28 14:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 14:36 FAILED: patch "[PATCH] mptcp: do not rely on implicit state check in mptcp_listen()" failed to apply to 6.1-stable tree gregkh
2023-07-27 14:16 ` [PATCH 6.1.y] mptcp: do not rely on implicit state check in mptcp_listen() Matthieu Baerts
2023-07-28 14:59 ` Matthieu Baerts [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=d9fb660d-c45f-e8e4-4995-9dba6de2d1f9@tessares.net \
--to=matthieu.baerts@tessares.net \
--cc=cpaasch@apple.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/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