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: 2cf1ba9a4d15c ("vhost_vdpa: implement IRQ offloading in vhost_vdpa")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211711
Signed-off-by: Gautam Dawar <redacted>
-----
changelog:
v2->v3:
- Re-submitting the patch in plain text format as suggested by Michael
- Added the fixes tag
v1->v2:
- Addressed Jason's comment to remove the irq check and use
vhost_vdpa_unsetup_vq_irq() to avoid local variable vq
-----
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2021-02-23 12:50:13
On Tue, Feb 23, 2021 at 06:15:07PM +0530, Gautam Dawar wrote:
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: 2cf1ba9a4d15c ("vhost_vdpa: implement IRQ offloading in vhost_vdpa")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211711
Signed-off-by: Gautam Dawar <redacted>
A bit better but still:
Applying: vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
error: corrupt patch at line 6
error: could not build fake ancestor
Patch failed at 0001 vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
hint: Use 'git am --show-current-patch=diff' to see the failed patch
you also want to include acks you got on the previous versions.
quoted hunk
-----
changelog:
v2->v3:
- Re-submitting the patch in plain text format as suggested by Michael
- Added the fixes tag
v1->v2:
- Addressed Jason's comment to remove the irq check and use
vhost_vdpa_unsetup_vq_irq() to avoid local variable vq
-----
Hi Michael,
I've submitted a fresh patch including the ack from Jason and after
testing with git am.
Regards,
Gautam
On Tue, 23 Feb 2021 at 18:20, Michael S. Tsirkin [off-list ref] wrote:
On Tue, Feb 23, 2021 at 06:15:07PM +0530, Gautam Dawar wrote:
quoted
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: 2cf1ba9a4d15c ("vhost_vdpa: implement IRQ offloading in vhost_vdpa")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211711
Signed-off-by: Gautam Dawar <redacted>
A bit better but still:
Applying: vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
error: corrupt patch at line 6
error: could not build fake ancestor
Patch failed at 0001 vhost_vdpa: fix the missing irq_bypass_unregister_producer() invocation
hint: Use 'git am --show-current-patch=diff' to see the failed patch
you also want to include acks you got on the previous versions.
quoted
-----
changelog:
v2->v3:
- Re-submitting the patch in plain text format as suggested by Michael
- Added the fixes tag
v1->v2:
- Addressed Jason's comment to remove the irq check and use
vhost_vdpa_unsetup_vq_irq() to avoid local variable vq
-----