]> git.ipfire.org Git - thirdparty/linux.git/commit
vsock/virtio: fix skb overhead overflow on 32-bit builds
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 21 May 2026 12:47:32 +0000 (14:47 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 23 May 2026 02:05:10 +0000 (19:05 -0700)
commit4157501b9a8ff1bbe32ff5a7d8aece7ab18eff40
treeb7cad3d345959255207318314dec17412acaccb9
parent3589d20a666caf30ad100c960a2de7de390fce88
vsock/virtio: fix skb overhead overflow on 32-bit builds

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%40redhat.com
Cc: stable@vger.kernel.org
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20260521124732.125771-1-sgarzare@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/virtio_transport_common.c