From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] qxl-render: add more sanity checks
Date: Fri, 29 Aug 2014 10:46:25 +0100 [thread overview]
Message-ID: <20140829094625.GE2398@work-vm> (raw)
In-Reply-To: <1409299007-19461-1-git-send-email-kraxel@redhat.com>
* Gerd Hoffmann (kraxel@redhat.com) wrote:
> Damn, the dirty rectangle values are signed integers. So the checks
> added by commit 788fbf042fc6d5aaeab56757e6dad622ac5f0c21 are not good
> enouth, we also have to make sure they are not negative.
>
> [ Note: There must be something broken in spice-server so we get
> negative values in the first place. Bug opened:
> https://bugzilla.redhat.com/show_bug.cgi?id=1135372 ]
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/display/qxl-render.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
> index cc2c2b1..bcc5c37 100644
> --- a/hw/display/qxl-render.c
> +++ b/hw/display/qxl-render.c
> @@ -138,7 +138,9 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl)
> if (qemu_spice_rect_is_empty(qxl->dirty+i)) {
> break;
> }
> - if (qxl->dirty[i].left > qxl->dirty[i].right ||
> + if (qxl->dirty[i].left < 0 ||
> + qxl->dirty[i].top < 0 ||
> + qxl->dirty[i].left > qxl->dirty[i].right ||
> qxl->dirty[i].top > qxl->dirty[i].bottom ||
> qxl->dirty[i].right > qxl->guest_primary.surface.width ||
> qxl->dirty[i].bottom > qxl->guest_primary.surface.height) {
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Should this go for stable as well?
(I was worried for a sec about what happens if right=width or bottom=height;
but looking at the code below it I think it's a dirty from left..(right-1)
so we're OK?)
Dave
> --
> 1.8.3.1
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2014-08-29 9:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 7:56 [Qemu-devel] [PATCH v2] qxl-render: add more sanity checks Gerd Hoffmann
2014-08-29 9:46 ` Dr. David Alan Gilbert [this message]
2014-08-29 10:39 ` Gerd Hoffmann
2014-08-29 12:09 ` Eric Blake
2014-08-29 12:51 ` 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=20140829094625.GE2398@work-vm \
--to=dgilbert@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).