mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
virtio-ccw: fix range check for SET_VQ
VIRTIO_PCI_QUEUE_MAX is already too big; a malicious guest would be able to trigger a write beyond the VirtQueue structure. Cc: qemu-stable@nongnu.org Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
627f91b1f8
commit
590fe5722b
1 changed files with 1 additions and 1 deletions
|
@ -266,7 +266,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align,
|
||||||
{
|
{
|
||||||
VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
|
VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
|
||||||
|
|
||||||
if (index > VIRTIO_PCI_QUEUE_MAX) {
|
if (index >= VIRTIO_PCI_QUEUE_MAX) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue