mirror of
https://github.com/torvalds/linux.git
synced 2026-12-01 11:03:37 +00:00
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 <[email protected]>
Cc: [email protected]
Cc: Sasha Levin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Tested-by: Jerome Marchand <[email protected]>