5a0f88db96
Fix CVE-2013-4148 (bnc#864812), CVE-2013-4149 (bnc#864649), CVE-2013-4150 (bnc#864650), CVE-2013-4151 (bnc#864653), CVE-2013-4526 (bnc#864671), CVE-2013-4527 (bnc#864673), CVE-2013-4529 (bnc#864678), CVE-2013-4530 (bnc#864682), CVE-2013-4531 (bnc#864796), CVE-2013-4533 (bnc#864655), CVE-2013-4534 (bnc#864811), CVE-2013-4535 / CVE-2013-4536 (bnc#864665), CVE-2013-4537 (bnc#864391), CVE-2013-4538 (bnc#864769), CVE-2013-4539 (bnc#864805), CVE-2013-4540 (bnc#864801), CVE-2013-4541 (bnc#864802), CVE-2013-4542 (bnc#864804), CVE-2013-6399 (bnc#864814), CVE-2014-0182 (bnc#874788) OBS-URL: https://build.opensuse.org/request/show/235280 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=211
37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
From f609ef91bccd8b1637575516a94a5dc0af804b40 Mon Sep 17 00:00:00 2001
|
|
From: "Michael S. Tsirkin" <mst@redhat.com>
|
|
Date: Mon, 12 May 2014 12:04:20 +0300
|
|
Subject: [PATCH] virtio: allow mapping up to max queue size
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
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: Andreas Färber <afaerber@suse.de>
|
|
---
|
|
hw/virtio/virtio.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
|
|
index 7f4e7ec..3557c17 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);
|