linux-sg2042/drivers/virtio
Michael S. Tsirkin 2989be09a8 virtio_pci: fix use after free on release
KASan detected a use-after-free error in virtio-pci remove code. In
virtio_pci_remove(), vp_dev is still used after being freed in
unregister_virtio_device() (in virtio_pci_release_dev() more
precisely).

To fix, keep a reference until cleanup is done.

Fixes: 63bd62a08c ("virtio_pci: defer kfree until release callback")
Reported-by: Jerome Marchand <jmarchan@redhat.com>
Cc: stable@vger.kernel.org
Cc: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Jerome Marchand <jmarchan@redhat.com>
2016-01-26 10:18:28 +02:00
..
Kconfig Add virtio-input driver. 2015-03-29 12:13:52 +10:30
Makefile Add virtio-input driver. 2015-03-29 12:13:52 +10:30
config.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
virtio.c virtio: fix memory leak of virtio ida cache layers 2015-12-07 17:28:01 +02:00
virtio_balloon.c virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
virtio_input.c virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
virtio_mmio.c virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
virtio_pci_common.c virtio_pci: fix use after free on release 2016-01-26 10:18:28 +02:00
virtio_pci_common.h virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
virtio_pci_legacy.c virtio-pci: alloc only resources actually used. 2015-06-24 08:15:09 +02:00
virtio_pci_modern.c virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
virtio_ring.c virtio_ring: use virt_store_mb 2016-01-12 20:47:02 +02:00