From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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 ; Wed, 2 Dec 2026 22:42:14 +0000 (UTC) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 232D21F00896; Wed, 2 Dec 2026 22:42:14 +0000 (UTC) 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== Subject: Re: [PATCH v1 net] tcp: Skip active TFO blackhole detection for passive sockets. From: netdev-bot+sashiko@kernel.org To: kuniyu@google.com 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 Date: Wed, 02 Dec 2026 22:42:13 +0000 Message-ID: <179625133368.3146.16470207858099388766@kernel.org> In-Reply-To: <20261201104011.2286047-1-kuniyu@google.com> References: <20261201104011.2286047-1-kuniyu@google.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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