Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Jiayuan Chen
Wed, 25 Nov 2026 12:46
[PATCH net] tcp: fix spurious RST when SYN_RECV race is lost
Author: Jiayuan Chen
Date: Wed, 25 Nov 2026 12:46
Date: Wed, 25 Nov 2026 12:46
54 lines
10019 bytes
10019 bytes
When the last ACK of 3WHS and the first data packet are processed on
different cpus, both can find the same req. The winner creates the
child and adds it to the accept queue. If this makes the accept queue
full, syn_recv_sock() fails for the loser and tcp_check_req() sends a
RST when tcp_abort_on_overflow is set. Only after that it finds the
req was stolen, and the packet is fed to the child.
The client gets a RST for a connection the server has accepted, and
the server application can even read the data.
Drop the req first, and do not send the RST if another cpu already
took it.
Fixes: 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table")
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
---
net/ipv4/tcp_minisocks.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index a05bb02e204c..934012cdac27 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -962,6 +962,13 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
}
embryonic_reset:
+ if (!fastopen) {
+ if (!inet_csk_reqsk_queue_drop(req->rsk_listener, req)) {
+ *req_stolen = true;
+ return NULL;
+ }
+ __NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
+ }
if (!(flg & TCP_FLAG_RST)) {
/* Received a bad SYN pkt - for TFO We try not to reset
* the local connection unless it's really necessary to
@@ -973,13 +980,6 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
reqsk_fastopen_remove(sk, req, true);
tcp_reset(sk, skb);
}
- if (!fastopen) {
- bool unlinked = inet_csk_reqsk_queue_drop(req->rsk_listener, req);
-
- if (unlinked)
- __NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
- *req_stolen = !unlinked;
- }
return NULL;
}
--
2.43.0
Re: [PATCH net] tcp: fix spurious RST when SYN_RECV race is lost
Author: netdev-bot+sinfo
Date: Wed, 25 Nov 2026 12:53
Date: Wed, 25 Nov 2026 12:53
19 lines
8519 bytes
8519 bytes
Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. *IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages. -- The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads