|
Hans de Goede |
c8dfc6 |
From c3236169b390617d13ede20ff0aed5d0bc1aba66 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
c8dfc6 |
From: Alon Levy <alevy@redhat.com>
|
|
Hans de Goede |
c8dfc6 |
Date: Tue, 21 Aug 2012 13:51:31 +0300
|
|
Hans de Goede |
c8dfc6 |
Subject: [PATCH 208/215] qxl/update_area_io: guest_bug on invalid parameters
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
Signed-off-by: Alon Levy <alevy@redhat.com>
|
|
Hans de Goede |
c8dfc6 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
c8dfc6 |
---
|
|
Hans de Goede |
c8dfc6 |
hw/qxl.c | 12 ++++++++++++
|
|
Hans de Goede |
c8dfc6 |
1 file changed, 12 insertions(+)
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
diff --git a/hw/qxl.c b/hw/qxl.c
|
|
Hans de Goede |
c8dfc6 |
index 95bbc03..baf9bb4 100644
|
|
Hans de Goede |
c8dfc6 |
--- a/hw/qxl.c
|
|
Hans de Goede |
c8dfc6 |
+++ b/hw/qxl.c
|
|
Hans de Goede |
c8dfc6 |
@@ -1386,6 +1386,18 @@ async_common:
|
|
Hans de Goede |
c8dfc6 |
QXLCookie *cookie = NULL;
|
|
Hans de Goede |
c8dfc6 |
QXLRect update = d->ram->update_area;
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
+ if (d->ram->update_surface > NUM_SURFACES) {
|
|
Hans de Goede |
c8dfc6 |
+ qxl_set_guest_bug(d, "QXL_IO_UPDATE_AREA: invalid surface id %d\n",
|
|
Hans de Goede |
c8dfc6 |
+ d->ram->update_surface);
|
|
Hans de Goede |
c8dfc6 |
+ return;
|
|
Hans de Goede |
c8dfc6 |
+ }
|
|
Hans de Goede |
c8dfc6 |
+ if (update.left >= update.right || update.top >= update.bottom) {
|
|
Hans de Goede |
c8dfc6 |
+ qxl_set_guest_bug(d,
|
|
Hans de Goede |
c8dfc6 |
+ "QXL_IO_UPDATE_AREA: invalid area (%ux%u)x(%ux%u)\n",
|
|
Hans de Goede |
c8dfc6 |
+ update.left, update.top, update.right, update.bottom);
|
|
Hans de Goede |
c8dfc6 |
+ return;
|
|
Hans de Goede |
c8dfc6 |
+ }
|
|
Hans de Goede |
c8dfc6 |
+
|
|
Hans de Goede |
c8dfc6 |
if (async == QXL_ASYNC) {
|
|
Hans de Goede |
c8dfc6 |
cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
c8dfc6 |
QXL_IO_UPDATE_AREA_ASYNC);
|
|
Hans de Goede |
c8dfc6 |
--
|
|
Hans de Goede |
c8dfc6 |
1.7.12
|
|
Hans de Goede |
c8dfc6 |
|