[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 106/108] vmstate_xhci_event: fix unterminated field
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 106/108] vmstate_xhci_event: fix unterminated field list |
Date: |
Wed, 6 Aug 2014 15:39:56 -0500 |
From: Laszlo Ersek <address@hidden>
"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>
(cherry picked from commit 3afca1d6d413592c2b78cf28f52fa24a586d8f56)
Signed-off-by: Michael Roth <address@hidden>
---
hw/usb/hcd-xhci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index ef3177a..0ceb10d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3703,6 +3703,7 @@ static const VMStateDescription vmstate_xhci_event = {
VMSTATE_UINT32(flags, XHCIEvent),
VMSTATE_UINT8(slotid, XHCIEvent),
VMSTATE_UINT8(epid, XHCIEvent),
+ VMSTATE_END_OF_LIST()
}
};
--
1.9.1
- [Qemu-stable] [PATCH 089/108] nbd: Don't export a block device with no medium., (continued)
- [Qemu-stable] [PATCH 089/108] nbd: Don't export a block device with no medium., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 074/108] hw: Consistently name Error ** objects errp, and not err, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 094/108] pc: make isapc and pc-0.10 to pc-0.13 have 1.7.0 memory layout, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 091/108] nbd: Close socket on negotiation failure., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 095/108] sdhci: Fix misuse of qemu_free_irqs(), Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 092/108] nbd: Shutdown socket before closing., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 096/108] hw: Fix qemu_allocate_irqs() leaks, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 093/108] SMBIOS: Rename symbols to better reflect future use, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 097/108] virtio: out-of-bounds buffer write on invalid state load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 098/108] virtio: validate config_len on load, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 106/108] vmstate_xhci_event: fix unterminated field list,
Michael Roth <=
- [Qemu-stable] [PATCH 099/108] Allow mismatched virtio config-len, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 105/108] kvm-all: Use 'tmpcpu' instead of 'cpu' in sub-looping to avoid 'cpu' be NULL, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 103/108] s390x/kvm: synchronize guest floating point registers, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 102/108] disas/libvixl: prepend the include path of libvixl header files, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 104/108] cadence_uart: check for serial backend before using it., Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 100/108] pci: assign devfn to pci_dev before calling pci_device_iommu_address_space(), Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 081/108] KVM: Fix GSI number space limit, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 101/108] mc146818rtc: register the clock reset notifier on the right clock, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 107/108] hw/misc/imx_ccm.c: Add missing VMState list terminator, Michael Roth, 2014/08/06
- [Qemu-stable] [PATCH 108/108] hw/arm/boot: Set PC correctly when loading AArch64 ELF files, Michael Roth, 2014/08/06