]> xenbits.xensource.com Git - qemu-upstream-4.3-testing.git/commit
virtio: error out if guest exceeds virtqueue size master
authorP J P <ppandit@redhat.com>
Mon, 25 Jul 2016 12:07:18 +0000 (17:37 +0530)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 27 Jul 2016 18:07:11 +0000 (11:07 -0700)
commit22f4cb04e3660b6be75ee9b6a4a8f8cfe8f8070f
tree09b78ddbff0f79e2501b3593df2ff92aa4b36afe
parent12e8fccf5b5460be7aecddc71d27eceaba6e1f15
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.

upstream-commit-id: afd9096eb1882f23929f5b5c177898ed231bac66
Reported-by: Zhenhao Hong <zhenhaohong@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/virtio.c