e74c0f316d
CVE-2017-7539: qemu-nbd crashes due to undefined I/O coroutine CVE-2017-11434: slirp: out-of-bounds read while parsing dhcp options CVE-2017-11334: exec: oob access during dma operation CVE-2017-10806: usb-redirect: stack buffer overflow in debug logging CVE-2017-10664: qemu-nbd: server breaks with SIGPIPE upon client abort CVE-2017-9524: nbd: segmentation fault due to client non-negotiation CVE-2017-9503: scsi: null pointer dereference while processing megasas command
43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
From 691689ab216143f5fefd8e229ffd91086b9a261e Mon Sep 17 00:00:00 2001
|
|
From: Ladi Prosek <lprosek@redhat.com>
|
|
Date: Tue, 30 May 2017 10:59:43 +0200
|
|
Subject: [PATCH 07/23] virtio-serial-bus: Unset hotplug handler when unrealize
|
|
|
|
Virtio serial device controls the lifetime of virtio-serial-bus and
|
|
virtio-serial-bus links back to the device via its hotplug-handler
|
|
property. This extra ref-count prevents the device from getting
|
|
finalized, leaving the VirtIODevice memory listener registered and
|
|
leading to use-after-free later on.
|
|
|
|
This patch addresses the same issue as Fam Zheng's
|
|
"virtio-scsi: Unset hotplug handler when unrealize"
|
|
only for a different virtio device.
|
|
|
|
Cc: qemu-stable@nongnu.org
|
|
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Reviewed-by: Fam Zheng <famz@redhat.com>
|
|
---
|
|
hw/char/virtio-serial-bus.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
|
|
index d797a6796e..aa9c11ae92 100644
|
|
--- a/hw/char/virtio-serial-bus.c
|
|
+++ b/hw/char/virtio-serial-bus.c
|
|
@@ -1121,6 +1121,9 @@ static void virtio_serial_device_unrealize(DeviceState *dev, Error **errp)
|
|
timer_free(vser->post_load->timer);
|
|
g_free(vser->post_load);
|
|
}
|
|
+
|
|
+ qbus_set_hotplug_handler(BUS(&vser->bus), NULL, errp);
|
|
+
|
|
virtio_cleanup(vdev);
|
|
}
|
|
|
|
--
|
|
2.11.0
|
|
|