From: Kevin Wolf <kwolf@redhat.com>
To: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] savevm: fix corruption in vmstate_subsection_load().
Date: Thu, 09 Jun 2011 14:48:00 +0200 [thread overview]
Message-ID: <4DF0C100.2040200@redhat.com> (raw)
In-Reply-To: <1295861427-30851-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp>
Am 24.01.2011 10:30, schrieb Yoshiaki Tamura:
> Although it's rare to happen in live migration, when the head of a
> byte stream contains 0x05 which is the marker of subsection, the
> loader gets corrupted because vmstate_subsection_load() continues even
> the device doesn't require it. This patch adds a checker whether
> subsection is needed, and skips following routines if not needed.
>
> Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>
> ---
> savevm.c | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index fcd8db4..3be875d 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1639,6 +1639,12 @@ static const VMStateDescription *vmstate_get_subsection(const VMStateSubsection
> static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,
> void *opaque)
> {
> + const VMStateSubsection *sub = vmsd->subsections;
> +
> + if (!sub || !sub->needed) {
> + return 0;
> + }
This means that subsections are silently ignored if the old version
didn't have any subsection for the device. Wasn't it a fundamental point
of the design of subsections that this would fail?
Noticed this when trying to use subsections to fix up IDE, and new ->
old migration after an I/O error only correctly fails when I revert this
patch.
Kevin
next prev parent reply other threads:[~2011-06-09 12:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 9:30 [Qemu-devel] [PATCH v2] savevm: fix corruption in vmstate_subsection_load() Yoshiaki Tamura
2011-01-24 15:35 ` [Qemu-devel] " Paolo Bonzini
2011-06-09 12:48 ` Kevin Wolf [this message]
2011-06-09 13:19 ` [Qemu-devel] " Paolo Bonzini
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=4DF0C100.2040200@redhat.com \
--to=kwolf@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=tamura.yoshiaki@lab.ntt.co.jp \
/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).