From nobody Sun May 24 20:35:36 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E460E3D25DE for ; Thu, 21 May 2026 12:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779367662; cv=none; b=qbxQks/w4jntUFnqivtRyUh0iqrBEnNWzDsIoC5A4MBjXFxlWKcpMxJ8+Qd0vVEw2FgISvaQpUCbuS0Cvq6bcTIg2SQHfdC3+8ISLaCzXoewathc/Ml8rRc5sMVXhcmHRv4u2EO2gOcXG3KdhwT1hwy0F3wbkrIDJ1Y7sHyv+0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779367662; c=relaxed/simple; bh=Dn6P2bkc/bzBUKXTydPjxy5n5j2Gvoyaa6sXWWpGFqs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NjCVYkdK4QpoIcQCoBgqLsNayWge1yvTnDfx1xccziwM4Q8nCqX1AAxiszT2TkSWdnrtqWtAoqz4Dl9QMa54m5wR77KLRq8XwYKNWhtf0NW8Pimxm9o/7cBpWK74SfVmOdpmXQ6aGb1A7+fhibF2TnF2vlauf1fpFlNgaF2R19Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cEdv2uv9; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Xp0hxeWX; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cEdv2uv9"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Xp0hxeWX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779367660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HUBSvYNIEeXrti7M5Q7uqS37K22xV9FH6FOTxmrZ3+g=; b=cEdv2uv9S5PUoDWCUjKwYwy2jQgBOlByzzN6LSxjphgYkQDRH9Xc8OBp0iFKqufMQYx2OW x1YnYQPNRTPOBJZGZ17W/M9/oBCkgQgfGD01miCzFN3qsNIOFhkxH6FgGPFrnXdIEm0pI8 FlwRcqhKQFAd+wtlRkeFavtmKE6h1gA= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-ygzCcXTpMmCquc4t_cZuUg-1; Thu, 21 May 2026 08:47:36 -0400 X-MC-Unique: ygzCcXTpMmCquc4t_cZuUg-1 X-Mimecast-MFC-AGG-ID: ygzCcXTpMmCquc4t_cZuUg_1779367656 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-44ffa15dc8cso3809046f8f.1 for ; Thu, 21 May 2026 05:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779367656; x=1779972456; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HUBSvYNIEeXrti7M5Q7uqS37K22xV9FH6FOTxmrZ3+g=; b=Xp0hxeWXTzkG+JHiiHIITTe2WKU43nP0bHUf05TxV1HgTZ6xQpVzHIoO1qlYNHdur9 fQeWw0tV/vFZMHGFpadBy0tHwJ2LYbI4NCGFVKfmCCydVOGXqaWd7OMce8ymgTD1lPfV LTYAEEq6WkMFwCpZhK4KlRaM+Q1UmEH4XrWWo0qLwqLe6a1I7P9pekWJs/NkqTNmHikY u777LeE3eaYJjRIfG/bL7TjdsjjTk8mxkqEJS1MgTmvzdQplVQ0IPAnXwprE9PftTvgp ZfWh7fbnE7rJhqKcJvBL47iVTUSrTtzfKpve8p+Pws5oCE6j3pw0QJH1DrPl4z+uBTc0 mYLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779367656; x=1779972456; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HUBSvYNIEeXrti7M5Q7uqS37K22xV9FH6FOTxmrZ3+g=; b=Ml94bkRnuxJxjXnwTVkRAIaLwUM1W1UmKp/sivSjRqBtfKeeq5hz2cItj4Sh1i+nl8 LKSepl4dJ5BRQqTjhxbbDRXLobvbp3Qp4mO2Hy8if39mhKqpsZIzdzj+PH9ibfakAYzL 19Rb2yEZ8yjGv+PdppC2LPXex1SZ419uWZjhsVNvSAnIsnLNfXv8vvTPBCHgLDU2+QPz 1mM0AGclTtx7Nyw7yxu4Czyxg4+C6ESVM0u6mrwrxy7UByyvGhdKMYG6+8RqMupS3N3x esrBL7D2YkHg3Rhaagf/OMLruFCLgjIkYgAiWRcv+MA/X0el9nAowgQv4yZadVBJbmk/ Lzyw== X-Forwarded-Encrypted: i=1; AFNElJ+/tiZGAm2a+q2o+E1bgCcs8Sb+03FqA6nWhQ4SnoD+GSHPnFTo3C7bEpHZ5OL7BCwBdOaSHrRfUve7yTk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3whd7ByJTsOfHHlUUwwqZh4clz7ShGkwT4SChDc52Uc/DyfEb 4MJgSQhjoWTmJub2OACqsPCtm8tlxh7OLrdjg3SXznMavVdRtR2Pr0pMW0E/A80TP3ARgKLipdY 0CDPX8t5sX3EulBWgpdMyl9HNRGxyeoJWeQefKxQKFDElvg5xlF7QVbppoCImoO5hCw== X-Gm-Gg: Acq92OE1cecR9LqtaOOOByzpmGBsQKV+RRdryKxvTAMBpWBdv7pQ7QnVECC87FBzZg1 2k2IwLIVTejR/bHszkJrC2EXdx0ukShLYLLHqfpalUFKMNIt1e0xYogANbMT0cM3tL/6PcsYEGP /lHJpgPJn8qhqFnnwBvHdiYo0tyyhw7SssTd1jV0KkrUvO8mZZMqwcZzdWEbpviCyMqOjWt+06n Ee0ev9F1xaJvnr9bpaulVfzvJOD0YHjwnZbcS8Pss92rLJz3CQCzKxnXdcJGvET53jJN/XNCxta jKU3zXzUarqGyyjd4IuttKn8fTpTq3JTwadQ8VgZwGg3y46dkZJBSllWbt7mL2VwahseXKwNtIQ fZsEXzF7VIAy5cFwxBlwlGUgI27xDiWFeUvIFTkwJ4zPM09LKJkkZVFHiqoDUhEiGGNABq/ELvi W3qUSiNkeZt2g= X-Received: by 2002:a05:600c:3513:b0:48a:75b9:b0bc with SMTP id 5b1f17b1804b1-490360cce5fmr38604325e9.29.1779367655685; Thu, 21 May 2026 05:47:35 -0700 (PDT) X-Received: by 2002:a05:600c:3513:b0:48a:75b9:b0bc with SMTP id 5b1f17b1804b1-490360cce5fmr38603965e9.29.1779367655227; Thu, 21 May 2026 05:47:35 -0700 (PDT) Received: from stex1.redhat.corp (host-87-16-204-231.retail.telecomitalia.it. [87.16.204.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49033d52c8bsm69391315e9.8.2026.05.21.05.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 05:47:34 -0700 (PDT) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: Xuan Zhuo , Stefano Garzarella , Simon Horman , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jakub Kicinski , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Paolo Abeni , "Michael S. Tsirkin" , "David S. Miller" , Jason Wang , Stefan Hajnoczi , Eric Dumazet , stable@vger.kernel.org Subject: [PATCH net] vsock/virtio: fix skb overhead overflow on 32-bit builds Date: Thu, 21 May 2026 14:47:32 +0200 Message-ID: <20260521124732.125771-1-sgarzare@redhat.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella On 32-bit architectures, both skb_queue_len() and SKB_TRUESIZE(0) evaluate to 32-bit values. The multiplication can overflow before being assigned to the u64 skb_overhead variable, making the skb overhead check ineffective. Cast skb_queue_len() to u64 so the multiplication is always performed in 64-bit arithmetic. This issue was reported by Sashiko while reviewing another patch. Fixes: 059b7dbd20a6 ("vsock/virtio: fix potential unbounded skb queue") Closes: https://sashiko.dev/#/patchset/20260518090656.134588-1-sgarzare%40r= edhat.com Cc: stable@vger.kernel.org Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin --- net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio= _transport_common.c index df3b418e0392..71198bf23fc4 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -417,7 +417,7 @@ 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) { - u64 skb_overhead =3D (skb_queue_len(&vvs->rx_queue) + 1) * SKB_TRUESIZE(0= ); + u64 skb_overhead =3D ((u64)skb_queue_len(&vvs->rx_queue) + 1) * SKB_TRUES= IZE(0); =20 /* Allow at most buf_alloc * 2 total budget (payload + overhead), * similar to how SO_RCVBUF is doubled to reserve space for sk_buff --=20 2.54.0