]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/pci: Fix ordering of eventfd vs virqfd shutdown
authorAlex Williamson <alex.williamson@redhat.com>
Mon, 30 May 2016 13:50:10 +0000 (07:50 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 30 May 2016 13:50:10 +0000 (07:50 -0600)
commit98e244b970be608a1986e23985698e5a28d78d31
tree5d698890a0f6ab87af4c647908395f51d30e8356
parent50071cc55229e13f7b459c28388ff0f4e1bac824
vfio/pci: Fix ordering of eventfd vs virqfd shutdown

Both the INTx and MSI/X disable paths do an eventfd_ctx_put() for the
trigger eventfd before calling vfio_virqfd_disable() any potential
mask and unmask eventfds.  This opens a use-after-free race where an
inopportune irqfd can reference the freed signalling eventfd.  Reorder
to avoid this possibility.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_intrs.c