Re: [Qemu-devel] [PATCH 1/2] virtio: check VirtQueue Vring object is set

2017-11-24 Thread P J P
+-- On Fri, 24 Nov 2017, Paolo Bonzini wrote --+ | Why not check vring->num in virtio_queue_update_rings too? Yes, sent a revised patch v1. These checks seem to repeat through sequence of functions. I guess it'll help to do them in one place. Thank you. -- Prasad J Pandit / Red Hat Product Secur

Re: [Qemu-devel] [PATCH 1/2] virtio: check VirtQueue Vring object is set

2017-11-23 Thread Paolo Bonzini
On 23/11/2017 20:01, P J P wrote: > @@ -182,7 +182,7 @@ void virtio_queue_update_rings(VirtIODevice *vdev, int n) > { > VRing *vring = &vdev->vq[n].vring; > > -if (!vring->desc) { > +if (!vring->desc || !vring->align) { > /* not yet setup -> nothing to do */ > retu

[Qemu-devel] [PATCH 1/2] virtio: check VirtQueue Vring object is set

2017-11-23 Thread P J P
From: Prasad J Pandit An user could attempt to use an uninitialised VirtQueue object or unset Vring.align leading to a arithmetic exception. Add check to avoid it. Reported-by: Zhangboxian Signed-off-by: Prasad J Pandit --- hw/virtio/virtio.c | 11 --- 1 file changed, 8 insertions(+),