[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] virtio-net: Fix potential use-after-free
From: |
Amit Shah |
Subject: |
[Qemu-devel] [PATCH 3/4] virtio-net: Fix potential use-after-free |
Date: |
Wed, 27 Jul 2011 14:00:31 +0530 |
virtio_cleanup() will remove the VirtIONet struct that gets allocated
via virtio_common_init(). Ensure we don't dereference the structure
after calling the cleanup function.
Signed-off-by: Amit Shah <address@hidden>
---
hw/virtio-net.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index a32cc01..3f10391 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -1073,6 +1073,6 @@ void virtio_net_exit(VirtIODevice *vdev)
qemu_bh_delete(n->tx_bh);
}
- virtio_cleanup(&n->vdev);
qemu_del_vlan_client(&n->nic->nc);
+ virtio_cleanup(&n->vdev);
}
--
1.7.6
- [Qemu-devel] [PATCH 0/4] Fix virtio memleaks, Amit Shah, 2011/07/27
- [Qemu-devel] [PATCH 1/4] virtio-balloon: Add exit handler, fix memleaks, Amit Shah, 2011/07/27
- [Qemu-devel] [PATCH 2/4] virtio-blk: Fix memleak on exit, Amit Shah, 2011/07/27
- [Qemu-devel] [PATCH 3/4] virtio-net: Fix potential use-after-free,
Amit Shah <=
- [Qemu-devel] [PATCH 4/4] virtio: Plug memleak by freeing vdev, Amit Shah, 2011/07/27
- Re: [Qemu-devel] [PATCH 0/4] Fix virtio memleaks, Michael S. Tsirkin, 2011/07/27