mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
vfio/pci: Drain eventfd RCU callbacks on module exit
vfio_pci_eventfd_replace_locked() defers freeing replaced eventfds to
vfio_pci_eventfd_rcu_free(). A callback can remain queued after
close_device() returns and the device driver module reference is dropped.
Once the dependent driver is removed, vfio-pci-core can be unloaded while
the callback still points into its module text.
Wait for outstanding RCU callbacks before vfio-pci-core exits.
Fixes: 98693e0897 ("vfio/pci: Use RCU for error/request triggers to avoid circular locking")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Link: https://lore.kernel.org/r/20261003093806.544631-1-yaojiale02@163.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
This commit is contained in:
parent
b30b52c2fb
commit
3b2e9b0501
|
|
@ -2675,6 +2675,7 @@ static void vfio_pci_dev_set_try_reset(struct vfio_device_set *dev_set)
|
|||
static void vfio_pci_core_cleanup(void)
|
||||
{
|
||||
vfio_pci_uninit_perm_bits();
|
||||
rcu_barrier();
|
||||
}
|
||||
|
||||
static int __init vfio_pci_core_init(void)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user