From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbdDCSJ1 (ORCPT ); Mon, 3 Apr 2017 14:09:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51946 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbdDCSJ0 (ORCPT ); Mon, 3 Apr 2017 14:09:26 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 351B13DE3E Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 351B13DE3E Date: Mon, 3 Apr 2017 21:09:23 +0300 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Mike Galbraith , Jason Wang , virtualization@lists.linux-foundation.org, Thorsten Leemhuis , virtio-dev@lists.oasis-open.org, rjones@redhat.com Subject: [PATCH] virtio_pci: request irq error handling Message-ID: <1491242932-29700-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mutt-Fcc: =sent X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 18:09:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: 07ec51480b5e ("virtio_pci: use shared interrupts for virtqueues") Signed-off-by: Michael S. Tsirkin --- 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