linux-stable/drivers/virtio
Michael S. Tsirkin 4dc48eb2dd virtio-pci: fix use after free
commit 72103bd128 upstream.

Commit 31a3ddda16 introduced
a use after free in virtio-pci. The main issue is
that the release method signals removal of the virtio device,
while remove signals removal of the pci device.

For example, on driver removal or hot-unplug,
virtio_pci_release_dev is called before virtio_pci_remove.
We then might get a crash as virtio_pci_remove tries to use the
device freed by virtio_pci_release_dev.

We allocate/free all resources together with the
pci device, so we can leave the release method empty.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-21 14:35:17 -08:00
..
config.c Virtio interface 2007-10-23 15:49:54 +10:00
Kconfig virtio: expose for non-virtualization users too 2011-07-23 16:20:30 +09:30
Makefile virtio: balloon driver 2008-02-04 23:50:13 +11:00
virtio_balloon.c virtio balloon: kill tell-host-first logic 2011-05-30 11:14:13 +09:30
virtio_pci.c virtio-pci: fix use after free 2011-11-21 14:35:17 -08:00
virtio_ring.c virtio: add api for delayed callbacks 2011-05-30 11:14:16 +09:30
virtio.c virtio: fix format of sysfs driver/vendor files 2010-11-24 15:21:12 +10:30