From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WPO-0003Ob-7m for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9WPI-0001GL-2W for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9WPH-0001Fp-R7 for qemu-devel@nongnu.org; Thu, 06 Sep 2012 03:21:44 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q867LhWJ026606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Sep 2012 03:21:43 -0400 From: Gerd Hoffmann Date: Thu, 6 Sep 2012 09:21:34 +0200 Message-Id: <1346916100-12958-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1346916100-12958-1-git-send-email-kraxel@redhat.com> References: <1346916100-12958-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 08/14] qxl/update_area_io: guest_bug on invalid parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alon Levy , Gerd Hoffmann From: Alon Levy Signed-off-by: Alon Levy Signed-off-by: Gerd Hoffmann --- hw/qxl.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index 95bbc03..baf9bb4 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -1386,6 +1386,18 @@ async_common: QXLCookie *cookie = NULL; QXLRect update = d->ram->update_area; + if (d->ram->update_surface > NUM_SURFACES) { + qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: invalid surface id %d\n", + d->ram->update_surface); + return; + } + if (update.left >= update.right || update.top >= update.bottom) { + qxl_set_guest_bug(d, + "QXL_IO_UPDATE_AREA: invalid area (%ux%u)x(%ux%u)\n", + update.left, update.top, update.right, update.bottom); + return; + } + if (async == QXL_ASYNC) { cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO, QXL_IO_UPDATE_AREA_ASYNC); -- 1.7.1