[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/21] vhost-user: unregister slave req handler at cl
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 18/21] vhost-user: unregister slave req handler at cleanup time |
Date: |
Mon, 3 Jul 2017 22:45:49 +0300 |
From: Maxime Coquelin <address@hidden>
If the backend sends a request just before closing the socket,
the aio dispatcher might schedule its reading after the vhost
device has been cleaned, leading to a NULL pointer dereference
in slave_read();
vhost_user_cleanup() already closes the socket but it is not
enough, the handler has to be unregistered.
Signed-off-by: Maxime Coquelin <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/vhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 958ee09..2203011 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -779,6 +779,7 @@ static int vhost_user_cleanup(struct vhost_dev *dev)
u = dev->opaque;
if (u->slave_fd >= 0) {
+ qemu_set_fd_handler(u->slave_fd, NULL, NULL, NULL);
close(u->slave_fd);
u->slave_fd = -1;
}
--
MST
- [Qemu-devel] [PULL 08/21] pci: Replace pci_add_capability2() with pci_add_capability(), (continued)
- [Qemu-devel] [PULL 08/21] pci: Replace pci_add_capability2() with pci_add_capability(), Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 09/21] pci: Convert to realize, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 10/21] pci: Convert shpc_init() to Error, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 11/21] i386/kvm/pci-assign: Fix return type of verify_irqchip_kernel(), Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 12/21] i386/kvm/pci-assign: Use errp directly rather than local_err, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 15/21] hw/acpi: remove dead acpi code, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 14/21] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1(), Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 13/21] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize(), Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 16/21] intel_iommu: fix migration breakage on mr switch, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 17/21] vhost: ensure vhost_ops are set before calling iotlb callback, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 18/21] vhost-user: unregister slave req handler at cleanup time,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 20/21] virtio-net: fix tx queue size for !vhost-user, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 21/21] i386/acpi: update expected acpi files, Michael S. Tsirkin, 2017/07/03
- [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Michael S. Tsirkin, 2017/07/03
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Peter Maydell, 2017/07/11
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Ben Warren, 2017/07/11
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Peter Maydell, 2017/07/11
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Peter Maydell, 2017/07/11
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Michael S. Tsirkin, 2017/07/11
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Peter Maydell, 2017/07/11
- Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature, Laszlo Ersek, 2017/07/11