[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/25] clean up callback when del virtqueue
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PULL 20/25] clean up callback when del virtqueue |
Date: |
Wed, 26 Sep 2018 11:16:45 +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 f6a588ab57..57a603a65b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1604,6 +1604,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.17.1
- [Qemu-devel] [PULL 00/25] Net patches, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 25/25] e1000: indicate dropped packets in HW counters, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 24/25] net: ignore packet size greater than INT_MAX, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 23/25] pcnet: fix possible buffer overflow, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 22/25] rtl8139: fix possible out of bound access, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 19/25] docs: Add COLO status diagram to COLO-FT.txt, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 20/25] clean up callback when del virtqueue,
Jason Wang <=
- [Qemu-devel] [PULL 14/25] COLO: flush host dirty ram from cache, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 21/25] ne2000: fix possible out of bound access in ne2000_receive, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 17/25] COLO: notify net filters about checkpoint/failover event, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 18/25] COLO: quick failover process by kick COLO thread, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 13/25] savevm: split the process of different stages for loadvm/savevm, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 15/25] filter: Add handle_event method for NetFilterClass, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 11/25] qapi/migration.json: Rename COLO unknown mode to none mode., Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 05/25] COLO: Add block replication into colo process, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 07/25] COLO: Load dirty pages into SVM's RAM cache firstly, Jason Wang, 2018/09/25
- [Qemu-devel] [PULL 16/25] filter-rewriter: handle checkpoint and failover event, Jason Wang, 2018/09/25