From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E92F1E98EA; Wed, 15 Jan 2025 10:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736938536; cv=none; b=Hb7bksWdUJNJU2xZpEKNiB7gLXwVnRxzCrxNKx0B9OXXxnZW4EVFLbjq9+tfEr216Gb1sgiKdcVLOHtp3IoggJXAA5wCxVYiyB70XbEngENbIr/xFeTA1ogujM4ynfm8D5++LACWt/C0+hvMyGjFsaQ0+7QiJWpaYFvFaJznWFE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736938536; c=relaxed/simple; bh=XVxZZtJKToOcLL3paivXlFqFpO4Q9SY1Fxrbznt9siY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UzNbOIXArXPI2ybnOCpnCa8AkzFhcHow4X0mLz7D+08mwi3y07aOcNfwtEBHK92Z5mDE/FPIQCThqC4tchMOWLWAOU4wrigKMAPVZYqhjybsAoTinMZv4B7Wn/DGOscL/3uWdfu/mcYp9vN9UVLO6sG22DhFVRsegtP9BfL4vpA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=I3gDpMs4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="I3gDpMs4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBCB3C4CEDF; Wed, 15 Jan 2025 10:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736938536; bh=XVxZZtJKToOcLL3paivXlFqFpO4Q9SY1Fxrbznt9siY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3gDpMs4XU0x1LhZWb7/mqTcEF0xXGWKxBRndSF1Ff6oFyi8/vaKRIYdT9cgFVt0G YPqrB7PpMAp/R1pmLzp5vdXMpdgU3IvNwJliCN4OPuri5v7iOymVUk0SiNSazxMQWL wJtyVLy/a6P0jOQjc3NS/05NO0hAvJiaM9J1dCQo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhongqiu Duan , Kuniyuki Iwashima , Jason Xing , Eric Dumazet , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 021/129] tcp/dccp: allow a connection when sk_max_ack_backlog is zero Date: Wed, 15 Jan 2025 11:36:36 +0100 Message-ID: <20250115103555.214101613@linuxfoundation.org> X-Mailer: git-send-email 2.48.0 In-Reply-To: <20250115103554.357917208@linuxfoundation.org> References: <20250115103554.357917208@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhongqiu Duan [ Upstream commit 3479c7549fb1dfa7a1db4efb7347c7b8ef50de4b ] If the backlog of listen() is set to zero, sk_acceptq_is_full() allows one connection to be made, but inet_csk_reqsk_queue_is_full() does not. When the net.ipv4.tcp_syncookies is zero, inet_csk_reqsk_queue_is_full() will cause an immediate drop before the sk_acceptq_is_full() check in tcp_conn_request(), resulting in no connection can be made. This patch tries to keep consistent with 64a146513f8f ("[NET]: Revert incorrect accept queue backlog changes."). Link: https://lore.kernel.org/netdev/20250102080258.53858-1-kuniyu@amazon.com/ Fixes: ef547f2ac16b ("tcp: remove max_qlen_log") Signed-off-by: Zhongqiu Duan Reviewed-by: Kuniyuki Iwashima Reviewed-by: Jason Xing Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20250102171426.915276-1-dzq.aishenghu0@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- include/net/inet_connection_sock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 7b5e783ea24d..e85834722b8f 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h @@ -282,7 +282,7 @@ static inline int inet_csk_reqsk_queue_len(const struct sock *sk) static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk) { - return inet_csk_reqsk_queue_len(sk) >= READ_ONCE(sk->sk_max_ack_backlog); + return inet_csk_reqsk_queue_len(sk) > READ_ONCE(sk->sk_max_ack_backlog); } bool inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req); -- 2.39.5