Patch "virtio_pci: fix use after free on release" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
virtio_pci: fix use after free on release
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
virtio_pci-fix-use-after-free-on-release.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
2989be09a8a9d62a785137586ad941f916e08f83Mon Sep 17 00:00:00 2001
From: "Michael S. Tsirkin" <[email protected]>
Date: Thu, 14 Jan 2016 16:00:41 +0200
Subject: virtio_pci: fix use after free on release
From: Michael S. Tsirkin <[email protected]>
commit 2989be09a8a9d62a785137586ad941f916e08f83 upstream.
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.
--- drivers/virtio/virtio_pci_common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/virtio/virtio_pci_common.c +2 -0
@@ -545,6 +545,7 @@ err_enable_device:static void virtio_pci_remove (struct pci_dev *pci_dev) {struct virtio_pci_device *vp_dev =pci_get_drvdata (pci_dev); +struct device *dev =get_device (&vp_dev->vdev.dev);unregister_virtio_device (&vp_dev->vdev);
@@ -554,6 +555,7 @@ static void virtio_pci_remove(struct pcivirtio_pci_modern_remove (vp_dev);pci_disable_device (pci_dev); +put_device (dev); }static struct pci_driver virtio_pci_driver = {
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/virtio_pci-fix-use-after-free-on-release.patch queue-4.4/virtio_balloon-fix-race-by-fill-and-leak.patch queue-4.4/virtio_balloon-fix-race-between-migration-and-ballooning.patch