qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Alon Levy <alevy@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 08/14] qxl/update_area_io: guest_bug on invalid parameters
Date: Thu,  6 Sep 2012 09:21:34 +0200	[thread overview]
Message-ID: <1346916100-12958-9-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1346916100-12958-1-git-send-email-kraxel@redhat.com>

From: Alon Levy <alevy@redhat.com>

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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

  parent reply	other threads:[~2012-09-06  7:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06  7:21 [Qemu-devel] [PULL 00/14] spice patch queue Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 01/14] spice: abort on invalid streaming cmdline params Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 02/14] spice: notify spice server on vm start/stop Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 03/14] spice: notify on vm state change only via spice_server_vm_start/stop Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 04/14] spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 05/14] spice: add 'migrated' flag to spice info Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 06/14] spice: adding seamless-migration option to the command line Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 07/14] spice: increase the verbosity of spice section in "qemu --help" Gerd Hoffmann
2012-09-06  7:21 ` Gerd Hoffmann [this message]
2012-09-06  7:21 ` [Qemu-devel] [PATCH 09/14] qxl: disallow unknown revisions Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 10/14] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Gerd Hoffmann
2012-09-28  9:51   ` Paolo Bonzini
2012-10-07  9:35     ` Alon Levy
2012-10-08 13:16       ` Paolo Bonzini
2012-09-06  7:21 ` [Qemu-devel] [PATCH 11/14] configure: print spice-protocol and spice-server versions Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 12/14] spice: make number of surfaces runtime-configurable Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 13/14] qxl: Add set_client_capabilities() interface to QXLInterface Gerd Hoffmann
2012-09-06  7:21 ` [Qemu-devel] [PATCH 14/14] Remove #ifdef QXL_COMMAND_FLAG_COMPAT_16BPP Gerd Hoffmann
2012-09-10 13:33 ` [Qemu-devel] [PULL 00/14] spice patch queue Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346916100-12958-9-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=alevy@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).