From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 86FB139150B; Tue, 16 Jun 2026 16:29:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781627369; cv=none; b=kvMvyeTaUnCHQA83i/Yes0nmro8wy/E2dHfLFVSeAlIjH+7ojNpHcbqA7DNh6EVmkEIepAZHFwTbMnznb2K4SxkJvjEdLf9LNncKvo9FSC0dmEJNJ8Ufs/vqIzXzvQOiFB1QjbgaA0BHsgYP4aHGQxBmrizgtQj48uxmQZQmMgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781627369; c=relaxed/simple; bh=zGlkR6+hfCW0sL9PT1pKpNl1nS2ZSE2Pu5B6EVD0kmM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RIGrOYNyS5zTh+hBTWXm+5ulq3do62mo6q4tJLyXNWmKxTxJewrE9orrCoj5odTPx/N7ze2+8bZAOzqEiXbXJJY0qFuHovRlcLnrKwTI9YPar0PcgRyZP/Ar0pCaO6FBDhWPFwTwD1UYgK+IXcskqPs5X9x/gtUWKQRezg+0HJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MfrzH4n/; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MfrzH4n/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 869D21F000E9; Tue, 16 Jun 2026 16:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781627368; bh=P04Cte9YlZsHNxpr/aeUqoIS60DY7GhHmclo/YW4oUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MfrzH4n/8d6ZvyAUWhp2PiZsqyFCtazWoW50AJSN+8t5Cy5NBYWZT+O4lxLgUCid3 Wa5X/PuHj7VXDs4MKMJqQUng3C5oxcjgbNUdCvAtaGW7cSsNZ1btgCZWm6ByNso4Nz SsyRmWMEJxthqJAXa8mRyIlDcSdmPY9F6gYjjNVM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Raf Dickson , Stefano Garzarella , Paolo Abeni Subject: [PATCH 6.12 163/261] vsock/vmci: fix sk_ack_backlog leak on failed handshake Date: Tue, 16 Jun 2026 20:30:01 +0530 Message-ID: <20260616145052.624208791@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145044.869532709@linuxfoundation.org> References: <20260616145044.869532709@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Raf Dickson commit c05fa14db43ebef3bd862ca9d073981c0358b3f0 upstream. When vmci_transport_recv_connecting_server() returns an error, vmci_transport_recv_listen() calls vsock_remove_pending() but never calls sk_acceptq_removed(). This leaves sk_ack_backlog incremented permanently. Repeated handshake failures (malformed packets, queue pair alloc failure, event subscribe failure) cause sk_ack_backlog to climb toward sk_max_ack_backlog. Once it reaches the limit the listener permanently refuses all new connections with -ECONNREFUSED, a silent denial of service requiring a process restart to recover. The two existing sk_acceptq_removed() calls in af_vsock.c do not cover this path: line 764 checks vsock_is_pending() which returns false after vsock_remove_pending(), and line 1889 is only reached on successful accept(). Fix by balancing sk_acceptq_added() with sk_acceptq_removed() on the error path. Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Cc: stable@vger.kernel.org Signed-off-by: Raf Dickson Acked-by: Stefano Garzarella Link: https://patch.msgid.link/20260526104356.469928-1-rafdog35@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- net/vmw_vsock/vmci_transport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -972,8 +972,10 @@ static int vmci_transport_recv_listen(st err = -EINVAL; } - if (err < 0) + if (err < 0) { vsock_remove_pending(sk, pending); + sk_acceptq_removed(sk); + } release_sock(pending); vmci_transport_release_pending(pending);