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 7E4551F667C; Tue, 21 Jan 2025 18:06:37 +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=1737482797; cv=none; b=gm975IySr6scST0907Xv4gsjCT8XWHWR04Nr39nynYBi1c1viVXpqfwxmA25HjSN02Vqru//a5Z6wKanL1ZKjmLtYyklk3iOwaWcUK2nLRxF/wDvJJuU7XWmIlKKeGfUy4tBjsbteJxiLVcSFoRx9pBWQTKMrGLedthnME7vGWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737482797; c=relaxed/simple; bh=moj7Gre4nx1D6TY0SvDeFftU+31RPYv7obMNwpioWA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jyW6iz8mbcaJ5TKeYMOjpW6HS4/CBn1avwBo/OC7OAY36svDUnG7PN/51GSk2ciQrr6qfgW90CXeIcR23EFxMQaBjl3ydihHQi1Obf27/RUahWSBevlxgln5gsshlHRvPzxG8N4kq5FODJXx2yFfmJtq7d6oqXhHR9kzv3GuTG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Vs/ouNBK; 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="Vs/ouNBK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3818C4CEE0; Tue, 21 Jan 2025 18:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737482797; bh=moj7Gre4nx1D6TY0SvDeFftU+31RPYv7obMNwpioWA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vs/ouNBKyfEgFu5QgLnAgbLDgKFEZ8lakZBGY8mQgYsI6cS9C83FF2KGkK/Enh6yp CgbcNKyIA+2hpu4qUr+YpJd3rw9jCiEaTOylb303d4csM9rNKd7/7cfpegBd0jYmzt aa+t6f9sR1iFbVNUQI8WpgI+PsyydnR1gb4MpAZI= 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 5.15 012/127] tcp/dccp: allow a connection when sk_max_ack_backlog is zero Date: Tue, 21 Jan 2025 18:51:24 +0100 Message-ID: <20250121174530.148221838@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250121174529.674452028@linuxfoundation.org> References: <20250121174529.674452028@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 5.15-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 0bf19c1926ee..7a015055fe6d 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h @@ -278,7 +278,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