From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796234084; b=V1Z0eUCAJ1PeI3ukEbToiwlBYLeP80GujrW2rgHlhduLIQQB2YAlfA7ZjS0S+yjvAy/a ylFw4f4nLefvgm2OGpWx5TX5V/YouzYBW1jizSI7NO46ElUjXEo5JiKmEo4kE6o2tIn2R dHffD0YRVZAjT+A4kVzCFYjG5A++yjcKyR08v5VCR6jHKsChrlYyHl+VDeXTtOA21l0KI FAtL5jDeQmmvE7dz52oVfLhBO57JzwhxCRAQa63DNI6BPe7QkFQWC7HBHUXZAwIHdJw7/ hORQuPJlA24h3FWnpNbyk4vsZIFN/e9mcZWQDN9x7Xy0yhNhsSQxExT4+4nq9JA7f4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796234084; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: To:Cc:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=uddVSSRcUYfpg5rBx8PmYMsyRinOnDtgs2k2L7s6sxU=; b=IUWgv8tws51pQ4tf2lz9LSNX6zKFAN1UUKu0nEx3RDUOy0voSNke94npQfdL/OZ5BG0C yMT/ju0Aonpgp3uzUK2PkGeMfpIyzW8AYeLCeVCJfMFd40+ve09XZ7DK+LoztSGu/Iajx J+6HlEVm31uPZ33lwyeLaR06EyAkOdxrNowmOL13mkQ88ZP5jaYA/54KQy50DND0jsg3C kliRJHlrsmZfhUdhk6j096rglDLI0+v/Eyhmb4sXN+q45q3DTfXqFbknh+I33YyRSCOXO R98R+zCkSXr9z8k9vHcsTy8/oaM/c6cTyAxjXns45Tzs0xw/v0K9w85C8l8wRa4u6Kg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=A1FJ3FBL; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=rQEmhLdT; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 370D7606A322 for ; Wed, 2 Dec 2026 17:54:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 370D7606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=A1FJ3FBL; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=rQEmhLdT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796234083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uddVSSRcUYfpg5rBx8PmYMsyRinOnDtgs2k2L7s6sxU=; b=A1FJ3FBLAhU2DWR/cleAjw23MPDE88oA4UaY5W+z6QYidzoD3xBiSkQoazULire4Bbdz0l t1z+xen77PmkUnbNjXJ2MJfTQfdSRblxcnh9urqTWXzq/LqDI7+W21ZWfXwLb/fJUbmEQC s5Skw8XIRFmNahjNgrTmfxSNPITUBrk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-634-VJyHx0RnN0GERzTSw6zOAA-1; Wed, 2 Dec 2026 17:54:40 +0000 X-MC-Unique: VJyHx0RnN0GERzTSw6zOAA-1 X-Mimecast-MFC-AGG-ID: VJyHx0RnN0GERzTSw6zOAA_1796234079 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4bb67b2c00cso404265e9.1 for ; Wed, 02 Dec 2026 09:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796234079; x=1796838879; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uddVSSRcUYfpg5rBx8PmYMsyRinOnDtgs2k2L7s6sxU=; b=rQEmhLdTs9jVrbCvBujTakkZC3lrtejyM8Rgultd7BrODueSpqiyeGe1yTPZtEQhF3 73D7oNTKrlTVkbSXOMRm7sVtxxgzhAgQkjs6e429nRVZtIyfWL0MYS4b1EV+/V+XU/x6 Pqk3JgY92Q7qxnKu7wqJX5WwB1WPQI30xNvHgNqYQXi0Qiv4RJIC0jcUXuBQPJH83fd1 QCWMo24zyoSfu7oFORihAsfwm1eJnew/87k3erkE237n36HlafORn5hldrmDnnq+rrGi jPQfMiuBhsLd3ZGFm4QZWaUnVxy5/WL3MgbJPr5HIFG0xB24zArElnI2oht7NW77rSUR YcQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796234079; x=1796838879; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uddVSSRcUYfpg5rBx8PmYMsyRinOnDtgs2k2L7s6sxU=; b=lmDtR+u3t1/oV5vtoJDSDj/2eiPcTCSqWr9TUYAiiWvAN8P6e/LENWOcfHWfUhBXDl nABncWRgYJr/hy+8+hh8fiyO/DIqi3ypeZ1aXI0pzk6ueXNT7eJZq2LX+hojZlBtOpmz i5i2w+xk9OK394vg05z9H2V4gHKJ+3k8uG3Gv7Eivr1IN2DidD1HtXJEfVDdULY2OXXh vOP1ouvUbDECsSN+iodqMqb2cUkbO8eZrozVLzSkhvxuf4zdLOPhaWzwaLb0HNKnRd8F vaKLiB+cjLyFIOW9px2Giq+ZKE0KITlBPVthcg7nf7OSDkdQq4EsgOXswlh1ciL9H+Fg S1Sw== X-Forwarded-Encrypted: i=1; AL+hErHaXO/8TxeA+vERXzz3Pzk+4ZPxxTOviW9qMK/mPMxMXDrMLihY3j6hXdINEe+SxdfcPXpfJOM=@vger.kernel.org X-Gm-Message-State: APuU4Z8btlLxc5SEw6xC1aGuLC94SU2RfXsylCQOYf9BRjMOjioJay7q SSrJedvz/GcwWo7V6dg9zUtbhehdu3CKybfVJzIZzHxgz8XCkVYYzA2Cg5MUhlfovPRg0lfGjuJ dAQQzzmVCpQpdJ6ZPTUAoVcEWvAg7yLbp1JugTBmSKVPhsrUtpeuQY+XObw== X-Gm-Gg: AZFdTZfFhoSSdV/MxjRrZX+dQA/vKvyMI7bDGcuWhNNksea08LGnuiH7iJLPdqjs6ln +0la8oGvusR3tzf8uImmXppSYaMk1/iyXKdbz837+UaT3gP81shEfXwSKkGVipbWs8TO/XSH9TB rIHs5L/rta9lJ2CgjBTO63bJVbLcwEPkoT7kBkk78MQOyk40HyiwZK948AnQJguT7v83OTkFToW yMHPL2hw5qQ7W4pW8YzWS8sPhxHCHb+I4BM2qsWAcp92tiEO1+7paRxtAOUm+/y/jjnPE65SWmw A4Mrv6ZnEE35nYQvwDQvqGU2VgR270/cRRoCQEbzYdG6FH7z6VP9P7u6UrlfLtKrSygw1GykTju 4QWKd0FjMy7X1scT1psnb29Yf8/ZSAkjXd5fJESvR1HUI0bV6yOBFrlbC/6wbB0qHrL56csatDM rLCFhZPpWrOdsInE1vlay9fzyWhIxCUGO0p4qOTwC7lRo= X-Received: by 2002:a05:600c:4504:b0:4b4:a551:681a with SMTP id 5b1f17b1804b1-4bb887fc396mr822970965e9.3.1796234079351; Wed, 02 Dec 2026 09:54:39 -0800 (PST) X-Received: by 2002:a05:600c:4504:b0:4b4:a551:681a with SMTP id 5b1f17b1804b1-4bb887fc396mr822970595e9.3.1796234078865; Wed, 02 Dec 2026 09:54:38 -0800 (PST) Received: from [192.168.88.30] (ip231-128-192-82.pool-bba.aruba.it. [82.192.128.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbb39dd4e7sm408017655e9.0.2026.12.02.09.54.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 09:54:38 -0800 (PST) Message-ID: <677b5e17-01e1-4321-9c24-ad222ebe48bb@redhat.com> Date: Wed, 2 Dec 2026 18:54:37 +0100 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] tcp: fix spurious RST when SYN_RECV race is lost To: Jiayuan Chen , xxx@vger.kernel.org Cc: Eric Dumazet , Neal Cardwell , Kuniyuki Iwashima , "David S. Miller" , Jakub Kicinski , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261125124653.289409-1-jiayuan.chen@linux.dev> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20261125124653.289409-1-jiayuan.chen@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/25/26 13:46, Jiayuan Chen wrote: > 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 > --- > 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; > } @Kuniyuki, @Neal: could you please have a look here? Thanks! Paolo