]> xenbits.xensource.com Git - qemu-xen-traditional.git/commit
virtio: error out if guest exceeds virtqueue size xen-4.8.0-rc1
authorP J P <ppandit@redhat.com>
Tue, 26 Jul 2016 14:31:59 +0000 (15:31 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 20 Sep 2016 15:35:23 +0000 (16:35 +0100)
commitc4e0d84d3c92923fdbc7fa922638d54e5e834753
treefd3cbf21227c327d7f0fa086450a0b0fa8220ec0
parent6e20809727261599e8527c456eb078c0e89139a1
virtio: error out if guest exceeds virtqueue size

A broken or malicious guest can submit more requests than the virtqueue
size permits.

The guest can submit requests without bothering to wait for completion
and is therefore not bound by virtqueue size.  This requires reusing
vring descriptors in more than one request, which is incorrect but
possible.  Processing a request allocates a VirtQueueElement and
therefore causes unbounded memory allocation controlled by the guest.

Exit with an error if the guest provides more requests than the
virtqueue size permits.  This bounds memory allocation and makes the
buggy guest visible to the user.

Reported-by: Zhenhao Hong <zhenhaohong@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/virtio.c