From nobody Mon Jun 8 17:55:57 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 14D3A44CACB for ; Wed, 27 May 2026 17:10:56 +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=1779901858; cv=none; b=VqbvpfV0ZiU1A3H/iUhN4/VcaqarogdGzvY9vt7QJRSYtkl9325PKWToMMKhUj/hBPH6lnNudSEJJ5kr6oQyI1PowNtzQB82NHq5WwmWKjdsNyOXO3Hw7tTLOkh4iLNUNTXwhXsAV0inV4pNr9g+HYGWbe5UFj9sJC7BQmOiKNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779901858; c=relaxed/simple; bh=Y9H0GY6k4T9clxSJ4yaRMplKa33pAMEcbXdMFf6KU6g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=C2gZoKJzl+Ah66DPnDROScYWP5+xwH3Gh/t7wDON3UVI0dCcm8SfYru3XL7t9ffzLEnVXq1t+sUHzzHfw6wLTQyRjfQkln0PI/bIZEl7sfkT696yLT4Nxp66PkrAKQdmDqun30fsgsYfj3ZMIZI8+tAHf0/ECxDZMAd/GELMMRM= 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=Q1lA5XNI; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=cEU/hSam; 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="Q1lA5XNI"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="cEU/hSam" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779901856; 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=1yn5UxI8QEgnLkFElBqvhz3nwZebD8rthNLyz5wiHFs=; b=Q1lA5XNIIxMBGRvCICuCOpuJXpOAS/l3uQckKbefxwqJpz3GQlhwDZzQ5JJ0EeDDTFLqoi uvl5mCisVUDbnMn9SoLYx71z79FqrqqSCVh+oWHwvbIHTKi+tcgRhwhv7R4G9mLO/kNZjm TLkoZgiwPZM86VtrD7+ngOELKQ+xygY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-AQX0aytaMnmVbFLFz5KZDQ-1; Wed, 27 May 2026 13:10:53 -0400 X-MC-Unique: AQX0aytaMnmVbFLFz5KZDQ-1 X-Mimecast-MFC-AGG-ID: AQX0aytaMnmVbFLFz5KZDQ_1779901851 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-49081106196so10018325e9.1 for ; Wed, 27 May 2026 10:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1779901851; x=1780506651; 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=1yn5UxI8QEgnLkFElBqvhz3nwZebD8rthNLyz5wiHFs=; b=cEU/hSam9VUD2VtmoNRQcDnEQgkJFC5q5GsCkutgzOaIkpHMqK07PAl+3oldB2fV9D rOOb5UeYM01Di7kvN7DD5+6NYxO2VFygXSVNPKiUVvo29BFvYOf6hOY/K/648ZBLx/5i B+JqYiE4ipVBogl/VWZFKYAw3nbpSiGIMopmGyxwdBvpUadXiM7UyoJMWvX1uuMIPkAG MDuu9asx3uYkkeNjQNnG3u1zwrss2EhZrhawPMhbVy3XhoUsfY5WKrnB2JbnKsN3Oibw +ydcxpRsk5gWO0bwvNcsM98HQz6f2fJsvK72Vrbb46DEsLgBBMuJDkuCMlVD2ANj3JwL xk9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779901851; x=1780506651; 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=1yn5UxI8QEgnLkFElBqvhz3nwZebD8rthNLyz5wiHFs=; b=YlgIwU6ZeRlB2RkxC968wUEOhWxLCBoo58ntNPluVHL+o3IHloTkpF4Gme61UQgU3H H7JQ9Pto67Be1Czcdu0UYLtoGWrQH44upD6Wxci3ZWzuPXBmqmPvKH8UeanUVLZFJqMX BLaHeW5w5Zpm4ArHr5GcHGCntMQGIqawUopFuE8tJitbchQgaA1FUe+Ph6dZ0bEqcuDC SHHZb2M4BhvYICI+oPFhEi8l0mwHXziE2++861zJdRflKUUB6ZWlhdj6bXfug6zyxi4P 8f/cqAyOOlAiVtrwVK1JLiWqZaSH08sCMol62dBOBLV1EfvD8i821wgcjnKM8GObIYuD pbAA== X-Forwarded-Encrypted: i=1; AFNElJ8k/51WVBlkUkxpjvxppa5M88VXcaIv8k+EgpgzcKfVK10oLDpx0wuhquykYA0k6ZF9YNHrWJvBjrHrufI=@vger.kernel.org X-Gm-Message-State: AOJu0YyqM6tcdIjiOG1tJzz5k1vKlhG9lESM8Hcri9Jo5YOcZ+YU9DKS L+kAyrDqT/KyHekGEwsYvVAAFHrSDf4+yoQeDx/fMtoDzP5LoN9sJAie1j3SCVW9d8928/vJGPC ONRt5ndO9QAWdnN/IZ2ge7YnZpKIz/MqKvmK/WZwqPzFjdfjrJ5rt9W7iheMjp39MZA== X-Gm-Gg: Acq92OGcwsl+8htmTTAUSsT2awzvmpa/dVy5XkxPjUDCKjSwbQXih7YWpGoremL0Ic/ 8N93f+fwZ5+0d6BRlYKrqUcYMzzlJU704qgyUUe7B79hIJ+h7EMNlpjYXL6eUY1qo1wEXmytUu+ 9TZvbJWSFSaUiPIcg2H8yYHd8g3LOxCEhRbWkcJrL70tZHiCIVPb6s+/CeYpBsMVwYXS7//Z34J zvukU1h/wbGVgW/JSzp0XfZ+Ow8apFC5VIxszRIPHLQmIMlYlOhLnM4BZQKPJ8abB1amR55bE07 bN9ja1DhVnjBakGAorSO8JwodENAb7eqfCgsechW6LDsImmS1pxtXWanpKcJRYt6o9uxBAObU+O 5f0SkJw0LYGGciQAwCnKAJdOVBr9WoQTDNHeEGr+gxZRkTbEiCGQ/i+h2mA== X-Received: by 2002:a05:600c:35c8:b0:48f:f7cc:f703 with SMTP id 5b1f17b1804b1-490428e2d58mr447180245e9.30.1779901851384; Wed, 27 May 2026 10:10:51 -0700 (PDT) X-Received: by 2002:a05:600c:35c8:b0:48f:f7cc:f703 with SMTP id 5b1f17b1804b1-490428e2d58mr447179465e9.30.1779901850888; Wed, 27 May 2026 10:10:50 -0700 (PDT) Received: from stex1 (host-82-53-135-12.retail.telecomitalia.it. [82.53.135.12]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4908097a320sm30225605e9.3.2026.05.27.10.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 10:10:48 -0700 (PDT) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: "David S. Miller" , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , virtualization@lists.linux.dev, Jakub Kicinski , linux-kernel@vger.kernel.org, Xuan Zhuo , "Michael S. Tsirkin" , kvm@vger.kernel.org, Paolo Abeni , Stefano Garzarella , Jason Wang , Simon Horman , Stefan Hajnoczi , Eric Dumazet , David Laight Subject: [PATCH RESEND net] Revert "vsock/virtio: fix skb overhead overflow on 32-bit builds" Date: Wed, 27 May 2026 19:10:46 +0200 Message-ID: <20260527171046.130211-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 This reverts commit 4157501b9a8f ("vsock/virtio: fix skb overhead overflow on 32-bit builds"). The fix was semantically correct (although it would have been better to use mul_u32_u32(), as David pointed out), but in practice we are estimating the memory used to allocate the SKBs, and this will never cause a 32-bit variable to overflow on a 32-bit system, since the memory would have run out long before that. On 64-bit, SKB_TRUESIZE() already evaluates to size_t, so the multiplication is already in 64-bit arithmetic without the cast. Let's revert this to avoid unnecessary 64-bit multiplies on the per-packet receive path on 32-bit systems. Reported-by: David Laight Closes: https://lore.kernel.org/netdev/20260523173557.5cc4f4f6@pumpkin Suggested-by: "Michael S. Tsirkin" Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Reviewed-by: David Laight --- 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 b143290a311d..d4d26fba9e37 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 ((u64)skb_queue_len(&vvs->rx_queue) + 1) * SKB_TRUES= IZE(0); + u64 skb_overhead =3D (skb_queue_len(&vvs->rx_queue) + 1) * SKB_TRUESIZE(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