Skip to contentSkip to conversation

virtio-ccw fix.

GIT PULL New Cornelia Huck 2 participants 3 messages Mar 26, 2013 – Mar 27, 2013

lore
Share & tools
lore
#0 lore raw

The ccw notify hypercall handler was missing a sanity check for the queue number, making it possible for an ill-behaving caller to crash qemu. Not good.

Please pull.

The following changes since commit e769bdc26ded6d7681cddd9f67c5f87a4b5ba53c:

hw/qdev: Abort rather than ignoring errors adding device properties (2013-03-26 09:27:02 -0500)

are available in the git repository at:

git://github.com/cohuck/qemu virtio-ccw-upstr

for you to fetch changes up to b57ed9bf075e33cdd2f9eb545ff555301dd57221:

virtio-ccw: Queue sanity check for notify hypercall. (2013-03-26 18:04:24 +0100)

----------------------------------------------------------------
Cornelia Huck (1):
virtio-ccw: Queue sanity check for notify hypercall.

 hw/s390x/s390-virtio-ccw.c |    3 +++
 1 file changed, 3 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 virtio-ccw: Queue sanity check for notify hypercall.

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

---
 hw/s390x/s390-virtio-ccw.c |    3 +++
 1 file changed, 3 insertions(+)
hw/s390x/s390-virtio-ccw.c +3 -0
index d436414..76b63e2 100644
@@ -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;
 
Signature · 1 line
1.7.9.5