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 7588B3C6A5C; Sat, 17 Oct 2026 17:40:18 +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=1792258819; cv=none; b=YcqvqrH75b7dlEPCS4yjJuJpAOQiQ6mNZIf2y/9rmCWEpFx8455H6VnKkv8DXc5TxYur2oYMmumNcya7yc6P52V0ZLAtwRXGIIwaRyWnvzrBWaCn+a/WuEbsPAqu6J22xsASBAKDPexWQ0Uz4qusplJdsYxzKxg2yYhwuoPz9UU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792258819; c=relaxed/simple; bh=9DVOCBwYc9jvQWLwcAGx2N/X2wX2h5HmwykolNHRhyw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=M7Uu75tHHbvYECPtPUY15l7wl5DcaBwmCzJ98RNI3UiVp0iDGxEFboWC8QTbxP8dTZdgRZbO7/jMOCljovdtnMhd9nXhe79rjNzFtYFWXrV5+DOj+TIKMIoddc756kG+o1V/8F8Vf+eILWew/NjXFJcwjlnSpDHohSFeiAP86W4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tR7e7spD; 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="tR7e7spD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAC9D1F000C4; Sat, 17 Oct 2026 17:40:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792258818; bh=WnGNOOzELhTWmpwEIbD32F3gkSstH3IAkNJ/YCAzH9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tR7e7spDJlOGQXmpGxy0AWWwPYtjK3Pf8SbkogtFqFTYYlSpaptxUOSlCzL+y/mmZ GJz9XHL0BepXiW0x6MONVu8o/GvR2/uwNJRicHQo2d2nDoK2C5z7RJtkCTvrkoQ5VQ RVNVBejKSFS3KtaTmeJ75gO5qn6dWUPTSC1gMPYw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eric Dumazet , Arseniy Krasnov , Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , virtualization@lists.linux.dev, Jakub Kicinski , Sasha Levin Subject: [PATCH 6.6 1008/1674] vsock/virtio: fix potential unbounded skb queue Date: Sat, 17 Oct 2026 17:54:40 +0200 Message-ID: <20261017160457.007728876@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit 059b7dbd20a6f0c539a45ddff1573cb8946685b5 ] virtio_transport_inc_rx_pkt() checks vvs->rx_bytes + len > vvs->buf_alloc. virtio_transport_recv_enqueue() skips coalescing for packets with VIRTIO_VSOCK_SEQ_EOM. If fed with packets with len == 0 and VIRTIO_VSOCK_SEQ_EOM, a very large number of packets can be queued because vvs->rx_bytes stays at 0. Fix this by estimating the skb metadata size: (Number of skbs in the queue) * SKB_TRUESIZE(0) Fixes: 077706165717 ("virtio/vsock: don't use skbuff state to account credit") Signed-off-by: Eric Dumazet Cc: Arseniy Krasnov Cc: Stefan Hajnoczi Cc: Stefano Garzarella Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Xuan Zhuo Cc: "Eugenio Pérez" Cc: virtualization@lists.linux.dev Link: https://patch.msgid.link/20260430122653.554058-1-edumazet@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/vmw_vsock/virtio_transport_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index e2a5803c0bbb7..24aa9194e6862 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -283,7 +283,9 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, static bool virtio_transport_inc_rx_pkt(struct virtio_vsock_sock *vvs, u32 len) { - if (vvs->buf_used + len > vvs->buf_alloc) + u64 skb_overhead = (skb_queue_len(&vvs->rx_queue) + 1) * SKB_TRUESIZE(0); + + if (skb_overhead + vvs->buf_used + len > vvs->buf_alloc) return false; vvs->rx_bytes += len; -- 2.53.0