From: Gerd Hoffmann <kraxel@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 2/9] memory: add support getting and using a dirty bitmap copy.
Date: Thu, 27 Apr 2017 17:01:59 +0200 [thread overview]
Message-ID: <1493305319.31995.63.camel@redhat.com> (raw)
In-Reply-To: <20170427140006.GE4805@noname.str.redhat.com>
On Do, 2017-04-27 at 16:00 +0200, Kevin Wolf wrote:
> Am 21.04.2017 um 11:16 hat Gerd Hoffmann geschrieben:
> > +bool cpu_physical_memory_snapshot_get_dirty(DirtyBitmapSnapshot *snap,
> > + ram_addr_t start,
> > + ram_addr_t length)
> > +{
> > + unsigned long page, end;
> > +
> > + assert(start >= snap->start);
> > + assert(start + length <= snap->end);
>
> Not sure if this has been reported somewhere else, but I got an
> assertion failure here while booting a guest:
>
> $ ~/source/qemu/x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 2G -drive file=Windows-10-20170427.0-x86_64.qcow2,snapshot=on -usbdevice tablet -vga qxl
> qemu-system-x86_64: /home/kwolf/source/qemu/exec.c:1125: cpu_physical_memory_snapshot_get_dirty: Zusicherung >>start + length <= snap->end<< nicht erf?llt.
> Abgebrochen (Speicherabzug geschrieben)
>
> Unfortunately, I didn't have gdb attached or core dumps enabled, and it
> doesn't seem to reproduce easily, so I don't have anything that could
> help debugging it, but I thought I'd just let you know anyway.
Saw this a few times too, didn't have the time yet to dig deeper,
appears to happen due to a display update when the guest is half-way
through a mode switch and the vga registers are in inconsistent state.
Reproducer: boot fedora live iso, when isolinux switches back to text
mode it can trigger (one out of ten boots, loaded host seems to make it
more likely)
The easy way out is to just return false instead of asserting.
I want check how exactly this happens though, to make sure this isn't a
exploitable race (unlikely IMHO, but still worth checking ...). Also
I'd prefer to fix vga and keep the assert()s, they are a good sanity
check.
cheers,
Gerd
next prev parent reply other threads:[~2017-04-27 15:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-21 9:16 [Qemu-devel] [PATCH 0/9] hw/display: make display updates thread safe, part 1 Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 1/9] bitmap: add bitmap_copy_and_clear_atomic Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 2/9] memory: add support getting and using a dirty bitmap copy Gerd Hoffmann
2017-04-27 14:00 ` Kevin Wolf
2017-04-27 15:01 ` Gerd Hoffmann [this message]
2017-04-21 9:16 ` [Qemu-devel] [PATCH 3/9] vga: add vga_scanline_invalidated helper Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 4/9] vga: make display updates thread safe Gerd Hoffmann
2017-05-09 12:57 ` Ladi Prosek
2017-05-09 14:02 ` Gerd Hoffmann
2017-05-09 14:17 ` Ladi Prosek
2017-04-21 9:16 ` [Qemu-devel] [PATCH 5/9] framebuffer: " Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 6/9] exynos: " Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 7/9] g364fb: " Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 8/9] vmsvga: fix vmsvga_update_display Gerd Hoffmann
2017-04-21 9:16 ` [Qemu-devel] [PATCH 9/9] sm501: make display updates thread safe Gerd Hoffmann
2017-04-21 10:42 ` BALATON Zoltan
2017-04-24 12:09 ` Peter Maydell
2017-04-24 12:30 ` Gerd Hoffmann
2017-04-21 13:44 ` [Qemu-devel] [PATCH 0/9] hw/display: make display updates thread safe, part 1 Mark Cave-Ayland
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=1493305319.31995.63.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=crosthwaite.peter@gmail.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).