vsock/virtio: Validate length in packet header before skb_put()

vsock/virtio: Validate length in packet header before skb_put()

JIRA: https://issues.redhat.com/browse/RHEL-114300 CVE: CVE-2025-39718

commit 0dab92484474587b82e8e0455839eaf5ac7bf894 Author: Will Deacon will@kernel.org Date: Thu Jul 17 10:01:09 2025 +0100

sock/virtio: Validate length in packet header before skb_put()

When receiving a vsock packet in the guest, only the virtqueue buffer
size is validated prior to virtio_vsock_skb_rx_put(). Unfortunately,
virtio_vsock_skb_rx_put() uses the length from the packet header as the
length argument to skb_put(), potentially resulting in SKB overflow if
the host has gone wonky.

Validate the length as advertised by the packet header before calling
virtio_vsock_skb_rx_put().

Cc: <stable@vger.kernel.org>
Fixes: 71dc9ec9ac7d ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")
Signed-off-by: Will Deacon <will@kernel.org>
Message-Id: <20250717090116.11987-3-will@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Signed-off-by: Jon Maloy jmaloy@redhat.com

Edited by Jon Maloy

Merge request reports

Loading