[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL V2 20/26] clean up callback when del virtqueue
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL V2 20/26] clean up callback when del virtqueue |
Date: |
Fri, 19 Oct 2018 11:22:19 +0800 |
From: liujunjie <address@hidden>
Before, we did not clear callback like handle_output when delete
the virtqueue which may result be segmentfault.
The scene is as follows:
1. Start a vm with multiqueue vhost-net,
2. then we write VIRTIO_PCI_GUEST_FEATURES in PCI configuration to
triger multiqueue disable in this vm which will delete the virtqueue.
In this step, the tx_bh is deleted but the callback virtio_net_handle_tx_bh
still exist.
3. Finally, we write VIRTIO_PCI_QUEUE_NOTIFY in PCI configuration to
notify the deleted virtqueue. In this way, virtio_net_handle_tx_bh
will be called and qemu will be crashed.
Although the way described above is uncommon, we had better reinforce it.
CC: address@hidden
Signed-off-by: liujunjie <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/virtio/virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 4e61944..4136d23 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1611,6 +1611,8 @@ void virtio_del_queue(VirtIODevice *vdev, int n)
vdev->vq[n].vring.num = 0;
vdev->vq[n].vring.num_default = 0;
+ vdev->vq[n].handle_output = NULL;
+ vdev->vq[n].handle_aio_output = NULL;
}
static void virtio_set_isr(VirtIODevice *vdev, int value)
--
2.5.0
- [Qemu-devel] [PULL V2 08/26] ram/COLO: Record the dirty pages that SVM received, (continued)
- [Qemu-devel] [PULL V2 08/26] ram/COLO: Record the dirty pages that SVM received, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 09/26] COLO: Flush memory data from ram cache, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 10/26] qmp event: Add COLO_EXIT event to notify users while exited COLO, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 11/26] qapi/migration.json: Rename COLO unknown mode to none mode., Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 12/26] qapi: Add new command to query colo status, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 14/26] COLO: flush host dirty ram from cache, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 13/26] savevm: split the process of different stages for loadvm/savevm, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 15/26] filter: Add handle_event method for NetFilterClass, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 17/26] COLO: notify net filters about checkpoint/failover event, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 19/26] docs: Add COLO status diagram to COLO-FT.txt, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 20/26] clean up callback when del virtqueue,
Jason Wang <=
- [Qemu-devel] [PULL V2 18/26] COLO: quick failover process by kick COLO thread, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 22/26] rtl8139: fix possible out of bound access, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 23/26] pcnet: fix possible buffer overflow, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 24/26] net: ignore packet size greater than INT_MAX, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 16/26] filter-rewriter: handle checkpoint and failover event, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 21/26] ne2000: fix possible out of bound access in ne2000_receive, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 25/26] e1000: indicate dropped packets in HW counters, Jason Wang, 2018/10/18
- [Qemu-devel] [PULL V2 26/26] qemu-options: Fix bad "macaddr" property in the documentation, Jason Wang, 2018/10/18
- Re: [Qemu-devel] [PULL V2 00/26] Net patches, Peter Maydell, 2018/10/19