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 B5B62439012; Fri, 15 May 2026 16:16:38 +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=1778861798; cv=none; b=CFbx9+ZOKPpKn9Z7+C4qrjYdmHYgq8r6yBlGzt4CmVPd2fcyy3nVhAl3GmQYeA4aJOEbxkmqDWsocSQG/cgXOSfuDO9N9v7LYdkxnK3uPfypmFKiowPCrcNjPVYqxcFG1kpG52d4Vg7vcOpnVPL2zYjeuL+CsRav6J03K2dSZQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778861798; c=relaxed/simple; bh=/uOoSPs84Qp/HYWLCkPifR5VZquZN+Ooh1YAq6Y0ni8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cb9g1jzpepPLPfZpBaXoGVx8myL0XeK94hRCGeawF7hAK72MVXAOgCKiixlBFIbuufdp0jcAOC1BHvCXbxFah9LBM4ISbulfgMpDS2/mgE1fgl+lpbUbH972pDOHkbZMNh/uFXBAHAKs7KiD7rzYK3WIY6J7RZ9v0cmYmayYSSY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qRJZhbug; 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="qRJZhbug" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D432C2BCB3; Fri, 15 May 2026 16:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778861798; bh=/uOoSPs84Qp/HYWLCkPifR5VZquZN+Ooh1YAq6Y0ni8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRJZhbug0suh+YHmwcdYr2XsR+NTFM8/DzJdRvoJU0g31vOq5YY4ZMI5dxrKEAd4K ZNK8PXFzL4DJE8kGObh0jeimaHVhAYxuEK31uWXfFVRula1J82AXA4jgajDbDIsRmK XgXLq9vwxhhk0G1mC0h0pUcUHQaXAsY2ALhOcvRE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dudu Lu , Bobby Eshleman , Luigi Leonardi , Stefano Garzarella , "Michael S. Tsirkin" , Paolo Abeni Subject: [PATCH 6.6 465/474] vsock/virtio: fix accept queue count leak on transport mismatch Date: Fri, 15 May 2026 17:49:34 +0200 Message-ID: <20260515154725.166762070@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev 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: Dudu Lu commit 52bcb57a4e8a0865a76c587c2451906342ae1b2d upstream. virtio_transport_recv_listen() calls sk_acceptq_added() before vsock_assign_transport(). If vsock_assign_transport() fails or selects a different transport, the error path returns without calling sk_acceptq_removed(), permanently incrementing sk_ack_backlog. After approximately backlog+1 such failures, sk_acceptq_is_full() returns true, causing the listener to reject all new connections. Fix by moving sk_acceptq_added() to after the transport validation, matching the pattern used by vmci_transport and hyperv_transport. Fixes: c0cfa2d8a788 ("vsock: add multi-transports support") Signed-off-by: Dudu Lu Reviewed-by: Bobby Eshleman Reviewed-by: Luigi Leonardi Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Link: https://patch.msgid.link/20260413131409.19022-1-phx0fer@gmail.com Signed-off-by: Paolo Abeni Cc: Luigi Leonardi Signed-off-by: Greg Kroah-Hartman --- net/vmw_vsock/virtio_transport_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -1353,8 +1353,6 @@ virtio_transport_recv_listen(struct sock return -ENOMEM; } - sk_acceptq_added(sk); - lock_sock_nested(child, SINGLE_DEPTH_NESTING); child->sk_state = TCP_ESTABLISHED; @@ -1376,6 +1374,7 @@ virtio_transport_recv_listen(struct sock return ret; } + sk_acceptq_added(sk); if (virtio_transport_space_update(child, skb)) child->sk_write_space(child);