]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vsock/virtio: Validate length in packet header before skb_put()
authorWill Deacon <will@kernel.org>
Thu, 17 Jul 2025 09:01:09 +0000 (10:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:07 +0000 (16:26 +0200)
commit969b06bd8b7560efb100a34227619e7d318fbe05
tree4146ea366de1d60d467c4c9f442d454ecf369862
parent85ea58de57220fd321cf6446bc485c8be65ef6f2
vsock/virtio: Validate length in packet header before skb_put()

commit 0dab92484474587b82e8e0455839eaf5ac7bf894 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/vmw_vsock/virtio_transport.c