qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 26/30] savevm: fix potential segfault on inva


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v4 26/30] savevm: fix potential segfault on invalid state
Date: Mon, 31 Mar 2014 17:04:41 +0100

On 31 March 2014 15:17, Michael S. Tsirkin <address@hidden> wrote:
> savevm will segfault if version_id < vmsd->minimum_version_id &&
> version_id >= vmsd->minimum_version_id_old

...and the vmstate has no load_state_old handler.

> This calls through a NULL pointer.  This is a bug (should
> exit not crash).

I'd previously assumed that this was a vmstate description
bug if it happened (ie that a vmstate with
minimum_version_id_old < minimum_version_id but no
load_state_old wasn't allowed).

Rather than failing migration here, wouldn't it be better
to either:
 (a) diagnose the bug, by asserting at the earliest
     opportunity
 (b) define that the value of minimum_version_id_old is not
     relevant unless load_state_old is set

I would strongly prefer (b) -- this would allow us to
remove the now-pointless setting of minimum_version_id_old
in huge numbers of vmstate structures. (Only five devices
make use of load_state_old: acpi, apic, i440fx, pit and
the ppc cpu).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]