From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN97R-0000HQ-UY for qemu-devel@nongnu.org; Tue, 02 Apr 2013 17:51:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN97Q-0000Ns-Kb for qemu-devel@nongnu.org; Tue, 02 Apr 2013 17:51:53 -0400 Sender: fluxion From: Michael Roth Date: Tue, 2 Apr 2013 16:45:27 -0500 Message-Id: <1364939142-30066-23-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1364939142-30066-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1364939142-30066-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 22/37] virtio-ccw: Queue sanity check for notify hypercall. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Cornelia Huck Verify that the virtio-ccw notify hypercall passed a reasonable value for queue. Cc: qemu-stable@nongnu.org Reported-by: Alexander Graf Signed-off-by: Cornelia Huck (cherry picked from commit b57ed9bf075e33cdd2f9eb545ff555301dd57221) Signed-off-by: Michael Roth --- 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 6549211..f90b5e4 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