linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Mike Galbraith <efault@gmx.de>, Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org,
	Thorsten Leemhuis <linux@leemhuis.info>,
	virtio-dev@lists.oasis-open.org, rjones@redhat.com
Subject: [PATCH] virtio_pci: request irq error handling
Date: Mon, 3 Apr 2017 21:09:23 +0300	[thread overview]
Message-ID: <1491242932-29700-1-git-send-email-mst@redhat.com> (raw)

On failure to request msix vectors virtio frees the vector map but fails
to reset it.  It will then attempt to use that map in vp_remove_vqs on
device removal and hybernation, resulting in memory corruption
manifesting as warnings in PCI core, hangs etc.

Reported-by: Mike Galbraith <efault@gmx.de>
Fixes: 07ec51480b5e ("virtio_pci: use shared interrupts for virtqueues")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 drivers/virtio/virtio_pci_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index 2a353ab..2b1ea9b 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -266,6 +266,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
 out_remove_vqs:
 	vp_remove_vqs(vdev);
 	kfree(vp_dev->msix_vector_map);
+	vp_dev->msix_vector_map = NULL;
 out_disable_config_irq:
 	vp_dev->config_vector(vp_dev, VIRTIO_MSI_NO_VECTOR);
 out_free_config_irq:
-- 
MST

                 reply	other threads:[~2017-04-03 18:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491242932-29700-1-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=efault@gmx.de \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=rjones@redhat.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).