lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101103201732.7400.28058.stgit@s20.home>
Date:	Wed, 03 Nov 2010 14:17:33 -0600
From:	Alex Williamson <alex.williamson@...hat.com>
To:	pugs@...co.com
Cc:	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
	kvm@...r.kernel.org, alex.williamson@...hat.com
Subject: [PATCH] vfio: Fix PCI 2.3 shared interrupt

Trying to be too clever with setting the irq_disabled flag.  PCI 2.3
disabled devices can still share IRQs, which can lead to clearing
the irq_disabled flag, preventing the EOI from registering, and leaving
the device without interrupts.  Interrupt handler should only ever
set irq_disabled and we can exit earlier to avoid the config space
access if we know we're disabled.

Signed-off-by: Alex Williamson <alex.williamson@...hat.com>
---

 drivers/vfio/vfio_intrs.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/vfio/vfio_intrs.c b/drivers/vfio/vfio_intrs.c
index 604082c..73e3deb 100644
--- a/drivers/vfio/vfio_intrs.c
+++ b/drivers/vfio/vfio_intrs.c
@@ -57,6 +57,12 @@ irqreturn_t vfio_interrupt(int irq, void *dev_id)
 
 	spin_lock_irq(&vdev->irqlock);
 
+	/* INTX disabled interrupts can still be shared */
+	if (vdev->irq_disabled) {
+		spin_unlock_irq(&vdev->irqlock);
+		return ret;
+	}
+
 	if (vdev->pci_2_3) {
 		pci_block_user_cfg_access(pdev);
 
@@ -87,7 +93,8 @@ done:
 		ret = IRQ_HANDLED;
 	}
 
-	vdev->irq_disabled = (ret == IRQ_HANDLED);
+	if (ret == IRQ_HANDLED)
+		vdev->irq_disabled = true;
 
 	spin_unlock_irq(&vdev->irqlock);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ