]> git.itanic.dy.fi Git - linux-stable/commit
PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it
authorDexuan Cui <decui@microsoft.com>
Fri, 2 Aug 2019 22:50:20 +0000 (22:50 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 16:36:09 +0000 (18:36 +0200)
commitb9c2b99057bbffd0c519280e5348fa2888ef33f5
tree68e6a90831a41016f9200429521ec285b9b968e5
parentd87fee20c301afe00a2802a5156fa5b81df59176
PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it

commit 533ca1feed98b0bf024779a14760694c7cb4d431 upstream.

The slot must be removed before the pci_dev is removed, otherwise a panic
can happen due to use-after-free.

Fixes: 15becc2b56c6 ("PCI: hv: Add hv_pci_remove_slots() when we unload the driver")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/controller/pci-hyperv.c