tcp: fix spurious RST when SYN_RECV race is lost
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>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20261125124653.289409-1-jiayuan.chen@linux.dev
Signed-off-by: Willem de Bruijn <willemb@google.com>
1 file changed