diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-27 10:28:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-27 10:28:51 -0700 |
commit | 1a3d8691fd2ae95f5443b2d57f91f28f6ff4700d (patch) | |
tree | 6cdfaa6bf84bff7821ca618546010f7e57d7107d | |
parent | 6284c99cf12f1f01d8c931ba4226b0cfbc0c37db (diff) | |
parent | bd91b56cb3b27492963caeb5fccefe20a986ca8d (diff) | |
download | linux-1a3d8691fd2ae95f5443b2d57f91f28f6ff4700d.tar.gz linux-1a3d8691fd2ae95f5443b2d57f91f28f6ff4700d.tar.bz2 linux-1a3d8691fd2ae95f5443b2d57f91f28f6ff4700d.zip |
Merge tag 'pci-v4.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fix from Bjorn Helgaas:
"Fix a use-after-free error in fatal error recovery (Thomas Tai)"
* tag 'pci-v4.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI/AER: Work around use-after-free in pcie_do_fatal_recovery()
-rw-r--r-- | drivers/pci/pcie/err.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index f7ce0cb0b0b7..f02e334beb45 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -295,6 +295,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) parent = udev->subordinate; pci_lock_rescan_remove(); + pci_dev_get(dev); list_for_each_entry_safe_reverse(pdev, temp, &parent->devices, bus_list) { pci_dev_get(pdev); @@ -328,6 +329,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) pci_info(dev, "Device recovery from fatal error failed\n"); } + pci_dev_put(dev); pci_unlock_rescan_remove(); } |