OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com, vladimir.riabchun@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2 v3 09/10] ms/tcp: fastopen: note that a child socket was created
Date: Thu, 26 Nov 2026 08:11:09 +0200	[thread overview]
Message-ID: <20261126062617.2133758-11-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20261126062617.2133758-2-eva.kurchatova@virtuozzo.com>

From: Jeremy Harris <jgh@exim.org>

tcp: fastopen: note that a child socket was created

This uses up the last bit in a field of tcp_sock.

Signed-off-by: Jeremy Harris <jgh@exim.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20250423124334.4916-2-jgh@exim.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit bc2550b4e195754fbb24aac1f012d3dd9e3b4edc)

Taken as a prerequisite of 62754aad50d0b ("tcp: fix request_sock
use-after-free during Fast Open accept()").

https://virtuozzo.atlassian.net/browse/VSTOR-156045
Feature: fix ms/net

Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 include/linux/tcp.h     | 3 ++-
 net/ipv4/tcp.c          | 1 +
 net/ipv4/tcp_fastopen.c | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 5565cb4d0e31..07f0b949bff7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -384,7 +384,8 @@ struct tcp_sock {
 		syn_fastopen:1,	/* SYN includes Fast Open option */
 		syn_fastopen_exp:1,/* SYN includes Fast Open exp. option */
 		syn_fastopen_ch:1, /* Active TFO re-enabling probe */
-		syn_data_acked:1;/* data in SYN is acked by SYN-ACK */
+		syn_data_acked:1,/* data in SYN is acked by SYN-ACK */
+		syn_fastopen_child:1; /* created TFO passive child socket */
 
 	u8	keepalive_probes; /* num of allowed keep alive probes	*/
 	u32	tcp_tx_delay;	/* delay (in usec) added to TX packets */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4d6886a86246..bc0e987bd7e0 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3382,6 +3382,7 @@ int tcp_disconnect(struct sock *sk, int flags)
 	tp->rack.reo_wnd_persist = 0;
 	tp->rack.dsack_seen = 0;
 	tp->syn_data_acked = 0;
+	tp->syn_fastopen_child = 0;
 	tp->rx_opt.saw_tstamp = 0;
 	tp->rx_opt.dsack = 0;
 	tp->rx_opt.num_sacks = 0;
diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c
index 9764f72aeaf0..9178d5ef1a78 100644
--- a/net/ipv4/tcp_fastopen.c
+++ b/net/ipv4/tcp_fastopen.c
@@ -404,6 +404,7 @@ struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
 				}
 				NET_INC_STATS(sock_net(sk),
 					      LINUX_MIB_TCPFASTOPENPASSIVE);
+				tcp_sk(child)->syn_fastopen_child = 1;
 				return child;
 			}
 			NET_INC_STATS(sock_net(sk),
-- 
2.56.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-11-26  6:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  6:11 [Devel] [PATCH hci-8.2 v3 00/10] ms/net: backport request migration RCU fixes and lockless refcount ordering Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 01/10] ms/tcp: Fix potential UAF in reqsk_timer_handler() Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 02/10] ms/tcp: Fix imbalanced icsk_accept_queue count Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 03/10] ms/inet: reject unhashed sockets during established lookups Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 04/10] ms/net: restore refcount ordering for lockless socket access Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 05/10] ms/tcp: ipv6: do not read ireq->pktopts from tcp_v6_send_synack() Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 06/10] ms/tcp: ipv6: free ireq->ipv6_opt after an RCU grace period Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 07/10] ms/tcp: free saved_syn " Eva Kurchatova
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 08/10] ms/tcp: Pass req->rsk_listener to inet_csk_reqsk_queue_drop() in tcp_check_req() Eva Kurchatova
2026-11-26  6:11 ` Eva Kurchatova [this message]
2026-11-26  6:11 ` [Devel] [PATCH hci-8.2 v3 10/10] ms/tcp: fix request_sock use-after-free during Fast Open accept() Eva Kurchatova
2026-11-30 15:50 ` [Devel] [PATCH hci-8.2 v3 00/10] ms/net: backport request migration RCU fixes and lockless refcount ordering Konstantin Khorenko
2026-11-30 15:51 ` Konstantin Khorenko

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=20261126062617.2133758-11-eva.kurchatova@virtuozzo.com \
    --to=eva.kurchatova@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=vladimir.riabchun@virtuozzo.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