From: Amit Shah <amit.shah@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-stable@nongnu.org,
Juan Quintela <quintela@redhat.com>,
dgilbert@redhat.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.1 for-stable] vmstate_xhci_event: fix unterminated field list
Date: Tue, 22 Jul 2014 21:05:02 +0530 [thread overview]
Message-ID: <20140722153502.GG32103@grmbl.mre> (raw)
In-Reply-To: <1406042801-28212-1-git-send-email-lersek@redhat.com>
On (Tue) 22 Jul 2014 [17:26:41], Laszlo Ersek wrote:
> "vmstate_xhci_event" was introduced in commit 37352df3 ("xhci: add live
> migration support"), and first released in v1.6.0. The field list in this
> VMSD is not terminated with the VMSTATE_END_OF_LIST() macro.
>
> During normal use (ie. migration), the issue is practically invisible,
> because the "vmstate_xhci_event" object (with the unterminated field list)
> is only ever referenced -- via "vmstate_xhci_intr" -- if xhci_er_full()
> returns true, for the "ev_buffer" test. Since that field_exists() check
> (apparently) almost always returns false, we almost never traverse
> "vmstate_xhci_event" during migration, which hides the bug.
>
> However, Amit's vmstate checker forces recursion into this VMSD as well,
> and the lack of VMSTATE_END_OF_LIST() breaks the field list terminator
> check (field->name != NULL) in dump_vmstate_vmsd(). The result is
> undefined behavior, which in my case translates to infinite recursion
> (because the loop happens to overflow into "vmstate_xhci_intr", which then
> links back to "vmstate_xhci_event").
>
> Add the missing terminator.
>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Thanks for spotting this!
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Amit
next prev parent reply other threads:[~2014-07-22 15:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 15:26 [Qemu-devel] [PATCH for-2.1 for-stable] vmstate_xhci_event: fix unterminated field list Laszlo Ersek
2014-07-22 15:35 ` Amit Shah [this message]
2014-07-22 15:42 ` Paolo Bonzini
2014-07-22 15:48 ` Laszlo Ersek
2014-07-22 16:14 ` Peter Maydell
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=20140722153502.GG32103@grmbl.mre \
--to=amit.shah@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=quintela@redhat.com \
/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).