linux/drivers/virtio
Michael S. Tsirkin 593bd1058b virtio_pci: fix use after free on release
[ Upstream commit 2989be09a8 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2016-02-15 15:45:22 -05:00
..
config.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01: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
virtio.c virtio: drop virtio_device_is_legacy_only 2015-04-15 12:41:14 +09:30
virtio_balloon.c virtio_balloon: fix race by fill and leak 2016-02-03 15:31:09 -05:00
virtio_input.c Add virtio-input driver. 2015-03-29 12:13:52 +10:30
virtio_mmio.c virtio_mmio: support non-legacy balloon devices 2015-04-15 12:41:12 +09:30
virtio_pci_common.c virtio_pci: fix use after free on release 2016-02-15 15:45:22 -05:00
virtio_pci_common.h virtio_pci: add an option to disable legacy driver 2015-01-21 16:28:59 +10:30
virtio_pci_legacy.c virtio_pci: move probe/remove code to common 2015-01-21 16:28:51 +10:30
virtio_pci_modern.c virtio_pci: support non-legacy balloon devices 2015-04-15 12:41:13 +09:30
virtio_ring.c virtio: Avoid possible kernel panic if DEBUG is enabled. 2015-02-11 15:03:14 +10:30