linux-stable/drivers/vhost
Gautam Dawar 2ea2d3a798 vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
commit 4c050286bb upstream.

When qemu with vhost-vdpa netdevice is run for the first time,
it works well. But after the VM is powered off, the next qemu run
causes kernel panic due to a NULL pointer dereference in
irq_bypass_register_producer().

When the VM is powered off, vhost_vdpa_clean_irq() misses on calling
irq_bypass_unregister_producer() for irq 0 because of the existing check.

This leaves stale producer nodes, which are reset in
vhost_vring_call_reset() when vhost_dev_init() is invoked during the
second qemu run.

As the node member of struct irq_bypass_producer is also initialized
to zero, traversal on the producers list causes crash due to NULL
pointer dereference.

Fixes: 2cf1ba9a4d ("vhost_vdpa: implement IRQ offloading in vhost_vdpa")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211711
Signed-off-by: Gautam Dawar <gdawar.xilinx@gmail.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210224114845.104173-1-gdawar.xilinx@gmail.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-25 09:04:08 +01:00
..
iotlb.c vhost: Fix documentation 2020-09-24 05:54:36 -04:00
Kconfig vhost_vdpa: implement IRQ offloading in vhost_vdpa 2020-08-05 11:08:42 -04:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
net.c vhost_net: fix ubuf refcount incorrectly when sendmsg fails 2021-01-12 20:18:13 +01:00
scsi.c vhost scsi: fix error return code in vhost_scsi_set_endpoint() 2020-12-30 11:54:00 +01:00
test.c tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
test.h tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
vdpa.c vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation 2021-03-25 09:04:08 +01:00
vhost.c vhost: add helper to check if a vq has been setup 2020-11-15 17:30:54 -05:00
vhost.h vhost: add helper to check if a vq has been setup 2020-11-15 17:30:54 -05:00
vringh.c vringh: fix vringh_iov_push_*() documentation 2020-11-25 04:22:48 -05:00
vsock.c vhost: allow device that does not depend on vhost worker 2020-06-04 15:36:51 -04:00