diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-04 11:43:49 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-07-06 09:13:54 +0300 |
commit | 8b81bb3b069d4007bc44c8d5888d630b7f0b42ff (patch) | |
tree | ff4dbda5478a0b0d3367a776a2b60762ffc6dc59 /qemu-char.c | |
parent | dd98b71f4885814de9a64e7acc0e17b38ab7c38b (diff) |
virtio-pci: fix MSI memory region use after free
After memory region QOMification QEMU is stricter in detecting
wrong usage of the memory region API. Here it detected a
memory_region_destroy done before the corresponding
memory_region_del_subregion; the memory_region_destroy is
done by msix_uninit_exclusive_bar, the memory_region_del_subregion
is done by the PCI core's pci_unregister_io_regions before
pc->exit is called.
The problem was introduced by
commit 06a1307379fcd6c551185ad87679cd7ed896b9ea
virtio-pci: add device_unplugged callback
As noted in that commit log, virtio device kick callbacks need to be
stopped before generic virtio is cleaned up. This is because these are
notifications from pci proxy to the generic virtio device so they need
to be stopped in the unplug call before the virtio device is unrealized.
However interrupts are notifications from the virtio device to
the pci proxy so they need to stay around while the device
is realized.
The memory API misuse caused an assertion when hot-unplugging virtio
devices. Using the API correctly fixes the assertion.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'qemu-char.c')
0 files changed, 0 insertions, 0 deletions