qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org, kraxel@redhat.com, blauwirbel@gmail.com
Subject: [Qemu-devel] [PATCH v10 1/4] qxl/update_area_io: guest_bug on invalid parameters
Date: Tue, 21 Aug 2012 13:16:20 +0300	[thread overview]
Message-ID: <1345544183-19192-1-git-send-email-alevy@redhat.com> (raw)

Signed-off-by: Alon Levy <alevy@redhat.com>
---
v9->v10
 Use CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC instead of -D directly, define is created in config-host.h
 so hw/qxl.[ch] is unchanged except for s/QXL_HAS_IO_MONITORS_CONFIG_ASYNC/CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC
 (Blue Swirl)
 No other patches changed. Dropped the wrongly sent last patch.

 hw/qxl.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/qxl.c b/hw/qxl.c
index c2dd3b4..6c48eb9 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1385,6 +1385,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.11.2

             reply	other threads:[~2012-08-21 10:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 10:16 Alon Levy [this message]
2012-08-21 10:16 ` [Qemu-devel] [PATCH v10 2/4] qxl: disallow unknown revisions Alon Levy
2012-08-21 10:16 ` [Qemu-devel] [PATCH v10 3/4] qxl: add QXL_IO_MONITORS_CONFIG_ASYNC Alon Levy
2012-08-21 10:34   ` Gerd Hoffmann
2012-08-21 10:16 ` [Qemu-devel] [PATCH v10 4/4] configure: print spice-protocol and spice-server versions Alon Levy

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=1345544183-19192-1-git-send-email-alevy@redhat.com \
    --to=alevy@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=kraxel@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).