From: Petr Matousek <pmatouse@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
Anthony Liguori <aliguori@amazon.com>,
qemu-stable@nongnu.org
Subject: [Qemu-devel] [PATCH] vnc: sanitize bits_per_pixel from the client
Date: Mon, 27 Oct 2014 12:41:44 +0100 [thread overview]
Message-ID: <20141027114144.GU10820@dhcp-25-225.brq.redhat.com> (raw)
bits_per_pixel that are less than 8 could result in accessing
non-initialized buffers later in the code due to the expectation
that bytes_per_pixel value that is used to initialize these buffers is
never zero.
To fix this check that bits_per_pixel from the client is one of the
values that the rfb protocol specification allows.
This is CVE-2014-7815.
Signed-off-by: Petr Matousek <pmatouse@redhat.com>
---
ui/vnc.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/ui/vnc.c b/ui/vnc.c
index 0fe6eff..6c8fb1a 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2026,6 +2026,17 @@ static void set_pixel_format(VncState *vs,
return;
}
+ switch(bits_per_pixel) {
+ case 8:
+ case 16:
+ case 32:
+ break;
+ default:
+ vnc_client_error(vs);
+ return;
+ break;
+ }
+
vs->client_pf.rmax = red_max;
vs->client_pf.rbits = hweight_long(red_max);
vs->client_pf.rshift = red_shift;
--
1.9.3
next reply other threads:[~2014-10-27 11:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 11:41 Petr Matousek [this message]
2014-10-27 11:53 ` [Qemu-devel] [PATCH] vnc: sanitize bits_per_pixel from the client Gerd Hoffmann
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=20141027114144.GU10820@dhcp-25-225.brq.redhat.com \
--to=pmatouse@redhat.com \
--cc=aliguori@amazon.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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).