qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] virtio-ccw: Queue sanity check for notify hypercall


From: Cornelia Huck
Subject: [Qemu-devel] [PATCH] virtio-ccw: Queue sanity check for notify hypercall.
Date: Tue, 26 Mar 2013 18:09:06 +0100

Verify that the virtio-ccw notify hypercall passed a reasonable
value for queue.

Cc: address@hidden
Reported-by: Alexander Graf <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
 hw/s390x/s390-virtio-ccw.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index d436414..76b63e2 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -31,6 +31,9 @@ static int virtio_ccw_hcall_notify(const uint64_t *args)
     if (!sch || !css_subch_visible(sch)) {
         return -EINVAL;
     }
+    if (queue >= VIRTIO_PCI_QUEUE_MAX) {
+        return -EINVAL;
+    }
     virtio_queue_notify(virtio_ccw_get_vdev(sch), queue);
     return 0;
 
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]