linux/drivers/virtio
Jason Wang 9e35276a53 virtio_pci: harden MSI-X interrupts
We used to synchronize pending MSI-X irq handlers via
synchronize_irq(), this may not work for the untrusted device which
may keep sending interrupts after reset which may lead unexpected
results. Similarly, we should not enable MSI-X interrupt until the
device is ready. So this patch fixes those two issues by:

1) switching to use disable_irq() to prevent the virtio interrupt
   handlers to be called after the device is reset.
2) using IRQF_NO_AUTOEN and enable the MSI-X irq during .ready()

This can make sure the virtio interrupt handler won't be called before
virtio_device_ready() and after reset.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211019070152.8236-5-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2021-11-01 05:26:48 -04:00
..
Kconfig virtio-pci: introduce legacy device module 2021-11-01 04:30:34 -04:00
Makefile virtio-pci: introduce legacy device module 2021-11-01 04:30:34 -04:00
virtio_balloon.c virtio-balloon: Use virtio_find_vqs() helper 2021-09-06 07:20:56 -04:00
virtio_dma_buf.c virtio: fix build for configs without dma-bufs 2020-08-19 06:43:28 +02:00
virtio_input.c virtio-input: add multi-touch support 2021-02-23 07:52:59 -05:00
virtio_mem.c virtio-mem: use a single dynamic memory group for a single virtio-mem device 2021-09-08 11:50:23 -07:00
virtio_mmio.c virtio-mmio: Use to_virtio_mmio_device() to simply code 2021-03-14 04:37:35 -04:00
virtio_pci_common.c virtio_pci: harden MSI-X interrupts 2021-11-01 05:26:48 -04:00
virtio_pci_common.h virtio_pci: harden MSI-X interrupts 2021-11-01 05:26:48 -04:00
virtio_pci_legacy_dev.c virtio-pci: introduce legacy device module 2021-11-01 04:30:34 -04:00
virtio_pci_legacy.c virtio_pci: harden MSI-X interrupts 2021-11-01 05:26:48 -04:00
virtio_pci_modern_dev.c virtio-pci library: introduce vp_modern_get_driver_features() 2021-07-08 07:49:01 -04:00
virtio_pci_modern.c virtio_pci: harden MSI-X interrupts 2021-11-01 05:26:48 -04:00
virtio_ring.c virtio_ring: check desc == NULL when using indirect with packed 2021-11-01 05:26:47 -04:00
virtio_vdpa.c virtio_vdpa: setup correct vq size with callbacks get_vq_num_{max,min} 2021-11-01 04:30:35 -04:00
virtio.c virtio: write back F_VERSION_1 before validate 2021-10-13 08:35:36 -04:00