[Top][All Lists]

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

[Qemu-commits] [qemu/qemu] 3afca1: vmstate_xhci_event: fix unterminated

From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 3afca1: vmstate_xhci_event: fix unterminated field list
Date: Tue, 22 Jul 2014 10:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 3afca1d6d413592c2b78cf28f52fa24a586d8f56
  Author: Laszlo Ersek <address@hidden>
  Date:   2014-07-22 (Tue, 22 Jul 2014)

  Changed paths:
    M hw/usb/hcd-xhci.c

  Log Message:
  vmstate_xhci_event: fix unterminated field list

"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 <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Cc: address@hidden
Signed-off-by: Peter Maydell <address@hidden>

reply via email to

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