linux/drivers/vfio/pci
Alex Williamson 45d7cf5174 vfio/pci: Use RCU for error/request triggers to avoid circular locking
[ Upstream commit 98693e0897 ]

Thanks to a device generating an ACS violation during bus reset,
lockdep reported the following circular locking issue:

CPU0: SET_IRQS (MSI/X): holds igate, acquires memory_lock
CPU1: HOT_RESET: holds memory_lock, acquires pci_bus_sem
CPU2: AER: holds pci_bus_sem, acquires igate

This results in a potential 3-way deadlock.

Remove the pci_bus_sem->igate leg of the triangle by using RCU
to peek at the eventfd rather than locking it with igate.

Fixes: 3be3a074cf ("vfio-pci: Don't use device_lock around AER interrupt setup")
Signed-off-by: Alex Williamson <alex.williamson@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20251124223623.2770706-1-alex@shazbot.org
Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 13:55:12 +01:00
..
hisilicon hisi_acc_vfio_pci: bugfix the problem of uninstalling driver 2025-07-10 16:05:00 +02:00
mlx5 vfio/mlx5: fix possible overflow in tracking max message size 2025-08-20 18:30:48 +02:00
nvgrace-gpu vfio/nvgrace-gpu: Expose the blackwell device PF BAR1 to the VM 2025-02-21 14:01:26 +01:00
pds vfio/pds: replace bitmap_free with vfree 2025-10-15 12:00:14 +02:00
qat vfio/qat: fix overflow check in qat_vf_resume_write() 2024-12-09 10:41:04 +01:00
virtio vfio/pci: rename and export range_intersect_range 2024-02-22 12:20:20 -07:00
Kconfig vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices 2024-04-29 13:25:41 -06:00
Makefile vfio/qat: Add vfio_pci driver for Intel QAT SR-IOV VF devices 2024-04-29 13:25:41 -06:00
trace.h vfio/pci: Cleanup license mess 2019-01-22 11:06:05 -07:00
vfio_pci.c VFIO: Add the SPR_DSA and SPR_IAX devices to the denylist 2024-05-13 14:07:33 +00:00
vfio_pci_config.c vfio/pci: Handle INTx IRQ_NOTCONNECTED 2025-05-29 11:02:15 +02:00
vfio_pci_core.c vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-12-18 13:55:12 +01:00
vfio_pci_igd.c vfio: Use GFP_KERNEL_ACCOUNT for userspace persistent allocations 2023-01-23 11:26:29 -07:00
vfio_pci_intrs.c vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-12-18 13:55:12 +01:00
vfio_pci_priv.h vfio/pci: Use RCU for error/request triggers to avoid circular locking 2025-12-18 13:55:12 +01:00
vfio_pci_rdwr.c vfio/pci: Enable iowrite64 and ioread64 for vfio pci 2025-02-21 14:01:26 +01:00
vfio_pci_zdev.c Merge remote-tracking branch 'mlx5/mlx5-vfio' into v6.1/vfio/next 2022-09-08 10:44:34 -06:00