From: Stefano Brivio <sbrivio@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Pavel Emelyanov <xemul@scylladb.com>,
Laurent Vivier <lvivier@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>,
Jon Maloy <jmaloy@redhat.com>, Dmitry Safonov <dima@arista.com>,
Andrei Vagin <avagin@google.com>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net v2 0/2] Fix race condition between TCP_REPAIR dump and data receive
Date: Wed, 20 May 2026 10:08:48 +0200 (CEST) [thread overview]
Message-ID: <20260520100843.3646f1f6@elisabeth> (raw)
In-Reply-To: <20260519190352.45c8478e@kernel.org>
On Tue, 19 May 2026 19:03:52 -0700
Jakub Kicinski <kuba@kernel.org> wrote:
> On Mon, 18 May 2026 20:34:22 +0200 Stefano Brivio wrote:
> > Stefano Brivio (2):
> > tcp: Don't accept data when socket is in repair mode
>
> Not sure Eric is on board with this patch in the first place.
> Sound like it's not the intended use case for REPAIR so IMO
> it's up to TCP maintainers whether we want to support this.
> And it's definitely not a Fix.
Jakub, thanks for looking into this.
As I was pointing out on the v1 thread, I think it's a race
condition regardless of the usage, because after you switch a socket to
repair mode you can do separate operations on the socket and the
outcome will be inconsistent between them. It depends on external
conditions and looks quite fragile.
For example, you could dump a given length of the receive queue, just
to read it a moment later, but now the length is wrong.
Note that now, on the v1 thread, also Andrei, one of the authors of
TCP_REPAIR and the matching feature in CRIU, agreed that my "fix" makes
things safer:
https://lore.kernel.org/all/CAEWA0a4d-PpWpVexYGP5SLRuzj8hs1W1_Ww6qA4BBrkzSs4umQ@mail.gmail.com/
But I won't certainly insist on handling it as a fix and I'm now taking
care of the new feedback coming from Eric of course.
> > selftests: Add data path tests for TCP_REPAIR mode
>
> Please don't add a new target, fold it under net.
> Targets are a PITA to deal with in kselftests.
Sorry, I had no idea, I'll change that.
--
Stefano
prev parent reply other threads:[~2026-05-20 8:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 18:34 [PATCH net v2 0/2] Fix race condition between TCP_REPAIR dump and data receive Stefano Brivio
2026-05-18 18:34 ` [PATCH net v2 1/2] tcp: Don't accept data when socket is in repair mode Stefano Brivio
2026-05-18 18:34 ` [PATCH net v2 2/2] selftests: Add data path tests for TCP_REPAIR mode Stefano Brivio
2026-05-20 2:03 ` [PATCH net v2 0/2] Fix race condition between TCP_REPAIR dump and data receive Jakub Kicinski
2026-05-20 4:39 ` Eric Dumazet
2026-05-20 7:24 ` Laurent Vivier
2026-05-20 7:27 ` Eric Dumazet
2026-05-20 8:09 ` Stefano Brivio
2026-05-20 8:08 ` Stefano Brivio [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=20260520100843.3646f1f6@elisabeth \
--to=sbrivio@redhat.com \
--cc=avagin@google.com \
--cc=davem@davemloft.net \
--cc=david@gibson.dropbear.id.au \
--cc=dima@arista.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jmaloy@redhat.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=xemul@scylladb.com \
/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