From: Mat Martineau <mathew.j.martineau at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH mptcp-net] mptcp: fix DATA_FIN processing for orphaned sockets.
Date: Tue, 16 Feb 2021 18:05:46 -0800 [thread overview]
Message-ID: <f59d8596-3ca-78d4-8a9f-8e50d3d08357@linux.intel.com> (raw)
In-Reply-To: 723de05edd19a88776331f585deb6ce72d959eca.1613398456.git.pabeni@redhat.com
[-- Attachment #1: Type: text/plain, Size: 2026 bytes --]
On Mon, 15 Feb 2021, Paolo Abeni wrote:
> Currently we move orphaned msk socket directly from FIN_WAIT2
> state to close, with the rationale that incoming additional
> data could be just dropped by the TCP stack/TW sockets.
>
> Anyhow we miss sending MPTCP-level ack on incoming DATA_FIN,
> and that may hang the peers.
>
> Fixes: e16163b6e2b7 ("mptcp: refactor shutdown and close")
> Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
> ---
> I hope nobody is keeping track of nr of follow-ups x commit,
> because the referenced one could score a world record :(((
> ---
> net/mptcp/protocol.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
Thanks for catching this. Fix looks ready for the export branch, and -net
(if tests are good). Also a candidate for 5.11-stable?
Mat
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index ee5a2981df6da..f15c79ff6a53c 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2297,13 +2297,12 @@ static void mptcp_worker(struct work_struct *work)
> __mptcp_check_send_data_fin(sk);
> mptcp_check_data_fin(sk);
>
> - /* if the msk data is completely acked, or the socket timedout,
> - * there is no point in keeping around an orphaned sk
> + /* There is no point in keeping aroud an orphaned sk timedout or closed,
> + * but we need the msk around to reply to incoming DATA_FIN, even if
> + * orphaned and in FIN_WAIT2 state
> */
> if (sock_flag(sk, SOCK_DEAD) &&
> - (mptcp_check_close_timeout(sk) ||
> - (state != sk->sk_state &&
> - ((1 << inet_sk_state_load(sk)) & (TCPF_CLOSE | TCPF_FIN_WAIT2))))) {
> + (mptcp_check_close_timeout(sk) || sk->sk_state == TCP_CLOSE)) {
> inet_sk_state_store(sk, TCP_CLOSE);
> __mptcp_destroy_sock(sk);
> goto unlock;
> --
> 2.26.2
> _______________________________________________
> mptcp mailing list -- mptcp(a)lists.01.org
> To unsubscribe send an email to mptcp-leave(a)lists.01.org
>
--
Mat Martineau
Intel
next reply other threads:[~2021-02-17 2:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-17 2:05 Mat Martineau [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-17 13:57 [MPTCP] Re: [PATCH mptcp-net] mptcp: fix DATA_FIN processing for orphaned sockets Paolo Abeni
2021-02-17 19:50 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=f59d8596-3ca-78d4-8a9f-8e50d3d08357@linux.intel.com \
--to=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