PCI: hv: Fix synchronization between channel callback and hv_pci_bus_exit()
authorAndrea Parri (Microsoft) <parri.andrea@gmail.com>
Wed, 11 May 2022 22:32:07 +0000 (00:32 +0200)
committerWei Liu <wei.liu@kernel.org>
Fri, 13 May 2022 16:57:32 +0000 (16:57 +0000)
commitb4927bd272623694314f37823302f9d67aa5964c
treed71d5b64658c4c6314ace1bd460e68358eb4741e
parent9937fa6d1eb6fac95586970e17617a718919c858
PCI: hv: Fix synchronization between channel callback and hv_pci_bus_exit()

[ Similarly to commit a765ed47e4516 ("PCI: hv: Fix synchronization
  between channel callback and hv_compose_msi_msg()"): ]

The (on-stack) teardown packet becomes invalid once the completion
timeout in hv_pci_bus_exit() has expired and hv_pci_bus_exit() has
returned.  Prevent the channel callback from accessing the invalid
packet by removing the ID associated to such packet from the VMbus
requestor in hv_pci_bus_exit().

Signed-off-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Link: https://lore.kernel.org/r/20220511223207.3386-3-parri.andrea@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/pci/controller/pci-hyperv.c