From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33451 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfpsE-0003vo-Qm for qemu-devel@nongnu.org; Thu, 20 Jan 2011 03:28:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfpsC-0006Av-3H for qemu-devel@nongnu.org; Thu, 20 Jan 2011 03:28:06 -0500 Received: from mail-qy0-f180.google.com ([209.85.216.180]:40199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfpsB-0006Ao-U7 for qemu-devel@nongnu.org; Thu, 20 Jan 2011 03:28:04 -0500 Received: by qyk29 with SMTP id 29so342608qyk.4 for ; Thu, 20 Jan 2011 00:28:03 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4D37F20F.5040008@redhat.com> Date: Thu, 20 Jan 2011 09:27:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1292317658-15798-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> In-Reply-To: <1292317658-15798-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] savevm: fix corruption in vmstate_subsection_load(). List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yoshiaki Tamura Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, quintela@redhat.com On 12/14/2010 10:07 AM, Yoshiaki Tamura wrote: > Although it's rare to happen in live migration, when the head of a > byte stream contains 0x05 IIUC, this happens if you have VMS_STRUCT and the field after the VMS_STRUCT starts with 0x5. I think you should also add this in vmstate_subsection_load: sub_vmsd = vmstate_get_subsection(sub, idstr); if (sub_vmsd == NULL) { return -ENOENT; } + assert (!sub_vmsd->subsections); ret = vmstate_load_state(f, sub_vmsd, opaque, version_id); and this in vmstate_load_state: if (field->flags & VMS_STRUCT) { + assert (!vmsd->subsections); ret = vmstate_load_state(f, field->vmsd, addr, field->vmsd->version_id); } Paolo