diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-05-12 12:04:20 +0300 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2014-07-20 22:27:40 -0500 |
commit | 3ba1e617e7ae2b69a508a52b4f6cc301a9de95ce (patch) | |
tree | 1ade3f8707a9c2d8eab836a135914104b8962722 /hw | |
parent | 96e7f7a911077ac76c4b2ac1e31e0aeaa1fb2901 (diff) | |
download | qemu-3ba1e617e7ae2b69a508a52b4f6cc301a9de95ce.tar.gz |
virtio: allow mapping up to max queue size
It's a loop from i < num_sg and the array is VIRTQUEUE_MAX_SIZE - so
it's OK if the value read is VIRTQUEUE_MAX_SIZE.
Not a big problem in practice as people don't use
such big queues, but it's inelegant.
Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 937251408051e0489f78e4db3c92e045b147b38b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/virtio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index abfc4e9ce2..6523e62c29 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -430,7 +430,7 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr, unsigned int i; hwaddr len; - if (num_sg >= VIRTQUEUE_MAX_SIZE) { + if (num_sg > VIRTQUEUE_MAX_SIZE) { error_report("virtio: map attempt out of bounds: %zd > %d", num_sg, VIRTQUEUE_MAX_SIZE); exit(1); |