From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com
Subject: [Qemu-devel] [PATCH 2/2] qxl/verify_surface_cmd: check format != 0 (buggy drivers can do that)
Date: Tue, 20 Nov 2012 11:19:01 +0200 [thread overview]
Message-ID: <1353403141-32070-2-git-send-email-alevy@redhat.com> (raw)
In-Reply-To: <1353403141-32070-1-git-send-email-alevy@redhat.com>
Signed-off-by: Alon Levy <alevy@redhat.com>
---
hw/qxl.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/qxl.c b/hw/qxl.c
index af5f68e..91e4fec 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -455,6 +455,12 @@ static int verify_surface_cmd(PCIQXLDevice *qxl, QXLSurfaceCmd *cmd)
return 1;
}
}
+ if (cmd->type == QXL_SURFACE_CMD_CREATE &&
+ cmd->u.surface_create.format == 0) {
+ qxl_set_guest_bug(qxl, "QXL_CMD_SURFACE invalid format: %u\n",
+ cmd->u.surface_create.format);
+ return 1;
+ }
return 0;
}
--
1.8.0
next prev parent reply other threads:[~2012-11-20 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-20 9:19 [Qemu-devel] [PATCH 1/2] hw/qxl: extract verify_surface_cmd from qxl_track_command Alon Levy
2012-11-20 9:19 ` Alon Levy [this message]
2012-11-20 10:31 ` Gerd Hoffmann
2012-11-20 11:19 ` 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=1353403141-32070-2-git-send-email-alevy@redhat.com \
--to=alevy@redhat.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).