virtio: check VirtQueue Vring object is set
commit758ead31c7e17bf17a9ef2e0ca1c3e86ab296b43
authorPrasad J Pandit <pjp@fedoraproject.org>
Wed, 29 Nov 2017 17:44:27 +0000 (29 23:14 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 1 Dec 2017 17:05:58 +0000 (1 19:05 +0200)
treebd19c0514a7c1ed1e90bdf6df63d8e28744d3c8b
parent2fe45ec3bffbd3a26f2ed39f60bab0ca5217d8f6
virtio: check VirtQueue Vring object is set

A guest 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 <zhangboxian@huawei.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
hw/virtio/virtio.c