Commit 20063c7e authored by Will Deacon's avatar Will Deacon Committed by Isaac Manjarres
Browse files

FROMGIT: vsock/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: 71dc9ec9 ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")
Signed-off-by: default avatarWill Deacon <will@kernel.org>
Message-Id: <20250717090116.11987-3-will@kernel.org>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
(cherry picked from commit 774a14c4d15d0515f0ff88dfab7e08e22b07eb3e
 git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git

 vhost)
Bug: 421244320
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Change-Id: I2d6a8ce7d6284a262e24e5bec4a35796f018e64f
parent b8845cd4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment