Article View: linux.kernel.netdev
Article #25985Re: [PATCH v1 net] tcp: Skip active TFO blackhole detection for passive sockets.
From: netdev-bot+sashiko
Date: Wed, 02 Dec 2026 22:42
Date: Wed, 02 Dec 2026 22:42
102 lines
11586 bytes
11586 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch only partly achieves what its subject says, "Skip
active TFO blackhole detection for passive sockets".
--
tcp: Skip active TFO blackhole detection for passive sockets.
This patch removes the tp->syn_data_acked term from the check in
tcp_fastopen_active_detect_blackhole(). tcp_fastopen_add_skb() sets that
bit on passive TFO children, so consecutive RTOs on a passive socket
could pause active TFO for the whole netns.
> diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
> index 7f7eb3cc1c04c..61e57f21e4e41 100644
> --- a/net/ipv4/tcp_fastopen.c
> +++ b/net/ipv4/tcp_fastopen.c
> @@ -685,7 +685,7 @@ void tcp_fastopen_active_detect_blackhole(struct sock *sk, bool expired)
> * Fast Open globally after hitting the third consecutive timeout or
> * exceeding the configured timeout limit.
> */
> - if ((tp->syn_fastopen || tp->syn_data || tp->syn_data_acked) &&
> + if ((tp->syn_fastopen || tp->syn_data) &&
> (timeouts == 2 || (timeouts < 2 && expired))) {
> tcp_fastopen_active_disable(sk);
> NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENACTIVEFAIL);
[Severity: Medium]
Can tp->syn_fastopen or tp->syn_data still be set on a passive socket
here?
The active side sets these bits in tcp_syn_options() and
tcp_send_syn_data(). The only place either one gets cleared is the
transmit error path in tcp_send_syn_data():
net/ipv4/tcp_output.c:tcp_send_syn_data() {
...
if (!err) {
tp->syn_data = (fo->copied > 0);
...
if (err)
tp->syn_fastopen = 0;
...
}
tcp_disconnect() only resets the other two bits:
net/ipv4/tcp.c:tcp_disconnect() {
...
tp->syn_data_acked = 0;
tp->syn_fastopen_child = 0;
...
}
Consider a socket that does an active TFO connect (MSG_FASTOPEN or
TCP_FASTOPEN_CONNECT), then connect(AF_UNSPEC), then listen().
__inet_stream_connect() calls tcp_disconnect() and moves the socket back
to SS_UNCONNECTED / TCP_CLOSE, so listen() is allowed. The new listener
still has syn_fastopen and syn_data set.
Every child of that listener gets a copy of those bits, because the
whole tcp_sock is copied:
tcp_create_openreq_child()
inet_csk_clone_lock()
sk_clone_lock()
sock_copy()
tcp_create_openreq_child() does not clear syn_fastopen or syn_data.
Suppose one of these children, TFO or not, hits its third consecutive
RTO:
tcp_write_timeout()
tcp_fastopen_active_detect_blackhole()
tcp_fastopen_active_disable()
In that case the check above still passes. Active TFO is then paused for
the whole netns when tcp_fastopen_blackhole_timeout_sec is non-zero, and
TCPFastOpenActiveFail is incremented either way. This is the symptom the
commit message describes.
A reused active socket that later reconnects without TFO keeps the same
stale bits, so it would be treated as a TFO connection in the same way.
The syn_fastopen_child early return mentioned in the commit message would
only cover the TFO children of such a listener. Would it make sense to
also clear syn_fastopen and syn_data in tcp_disconnect(), or on the child
in tcp_create_openreq_child()?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201104011.2286047-1-kuniyu%40google.com
Technical Details
Message-ID:
<179625133368.3146.16470207858099388766@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376079-linux-kernel-netdev=dewy.ruReferences:
<20261201104011.2286047-1-kuniyu@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376079-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v1 net] tcp: Skip active TFO blackhole detection for passive sockets. Date: Wed, 02 Dec 2026 22:42:13 +0000 Organization: Usenet Network Message-ID: <179625133368.3146.16470207858099388766@kernel.org> References: <20261201104011.2286047-1-kuniyu@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2078271"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:zOvwRDEeLgXbFHHmjpDBJ0mEG0E= sha256:GueQZa3fBrrfsyJsO79rsrExloJ9O0P4qyQMX5HLgwk= sha1:xB0ZczQUiWIZL+LEQf1zJQdqFbg= sha256:hRtwa93+9mDYI/jTif9rJndu9xC+z6KvfA/WXDcnp8U= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 977EE11775A; Thu, 3 Dec 2026 01:42:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nyR7lIreRv6M; Thu, 3 Dec 2026 01:42:31 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376079-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id EC53D11771C; Thu, 3 Dec 2026 01:42:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3D52F277E8; Wed, 2 Dec 2026 22:42:17 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796251336; b=Zp9hWTWIYxUEZP6Ui3dHMvFsDsCHSl7OpgIr/6DZ27Xe+gKRW6yCMMeEY8P2tiftrRQ/ ggB2+gzDR2m++oKudFjaX9CmkKj+WAjZtc2cR91eyuFmm0faMUOkajOfD5WTY77OA8ulq N9gxPb/gbKMD1ybZMetXDf1pcvQ3QPwDIia+lQRu0HR2O1r2M9veDikltRgdOUSdSy3rm ZFJGCJS02BpsaS5zqrzhGlhkz4buIEMP1QwhymUSfKX48+FnuYpfTkfsH/cU1u0Za8YU9 VlNkAB06LYI2ydAYaxZkKbU83GUO2Tq4zv6rPMRbFRvXYLz9fvUStGi/iZsa0CLj18A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796251336; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=3wVuCtUEG0L2THke64AnAS085CxZdssfP5Zka/zc4EI=; b=R2/vkaKsOBjEhNW/88JYgZ5r8Cc+CsZNTg6JUpxxj2sJTak80uVWRHgq2UtAW5lsJqcO j7H/vzeFRhsBJYiUQ5YDAZoZjJoQMiWuBqOgxl32lICOd1b0Cwom7xIp40zRhlRWlJoKz SlBWIfsi/4StLTT4owAtGW0DpPphr+CyUtVS9a2njGeJ4gIvTCDBPZ/8w0jUS0D07huAL pSVasrkYQzLAULL3SwpNsmPAkyLGBGnE3CLsD29orOl6tgsSIZamj/LdrawPpI2YCKMps mgMbQOR524OcdplEJQBNdlYZeCCmcDqzr9H2DdDjrE/Van6xQuJwcgwJ22Y9n+N9tJg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fxmlamXo; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05D6D606A333; Wed, 2 Dec 2026 22:42:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fxmlamXo X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796251335; b=NmvSyNd+r9dKvyfK+ybMh3cjoC19wCYLTKa5yW0VLO1HUvZV+eZml49H8Ng30xIKXyxN sYNOUGaXNS38VUCCOq6zGH2v4ZUQMK6FSGF3n02MyZ9DZo3LqfOdoQ5QCVWdGpch0NoAi 1DC3AukA3xtYZeP5lx5znkmqdNCG6BghWoR4Ap5pgHxsT8u3NzqAj7lWV6IhR/wIObgzb 7WtM3lUQEdA0EcQcD1LpwfnjvHENLMZ1Tdi0eK7nR8jxnB4juw7YHTW2xDTg6fDbGD6XR bimAY7MHLlED6jl+sPbZQrgvuS79tL9bgWhJgnhwE4mtj/U+bKLuSpGncDyVLUxb3Cw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796251335; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=3wVuCtUEG0L2THke64AnAS085CxZdssfP5Zka/zc4EI=; b=l7E8ir1uFSX391UfCIQ2k710kSBdy5oa8tSRCURW/eOVNkAyjzcd0YV2c46GAFYI0Mrn z5zySsrgf6xGlLnVSAW8mSBIG8J8LZ763JqWyHYZ+NIknjl3251FBtun3aWYNLwhn+bqp xT80m+gJ2KAH44H3FAbZhXo+3aub9x9U7mRKQdwO0VvwffPS034WPbkIE3jbVlRdTh5TN /jJbHP5Dgc7tk/SJsTwZM7yfXB/WejJfU1tyrLBkzgS6UuCaqaF8ls+6feF3YRDRjbZCY kDRqpLqfbak7o5BeO7LMsSKH52utndpzGMes4cgGtxxcUZPObYnp0876qhYhozbVV6Q== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fxmlamXo; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2041A606A322 for <netdev@vger.kernel.org>; Wed, 2 Dec 2026 22:42:14 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 232D21F00896; Wed, 2 Dec 2026 22:42:14 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796251334; bh=3wVuCtUEG0L2THke64AnAS085CxZdssfP5Zka/zc4EI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=fxmlamXoIn9yGLApg+NAwTJh7duH5Gd5HCzxQ1cTircoMiF5/7vCn5j37O/gmp+An qJdIADDvu2iWn8cDfABe4nYTDVd/5JDnFP7zufGvM8MdESS4dSTyYtE5dD1iBkYRnt naXaPCCdVK6SNvkq0GV3U1Lm3r592Me5MpY85bhT0oNg3xROk7W6T6VoYqfmtWZgEg PRrJPgOwRNEeXfCYjPVA/0f6UGbZBhHoH3OQ4GO4mKQ08x+H+wYMaaX/zI6Lk6Q37R PVE1T4k2jvXqXiv4tW4gdMBDBU/BTVG42q2Gf8Y/C8kQwTH0rM8Jkp618Gh/17Yug7 SDaGPQ3IpMSag== X-Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, ycheng@google.com, kuni1840@gmail.com, netdev@vger.kernel.org X-In-Reply-To: <20261201104011.2286047-1-kuniyu@google.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list