Thread (19 messages) flat view 19 messages, 4 authors, 2019-07-05

Re: [PATCH v2 3/3] vsock/virtio: fix flush of works during the .remove()

From: Stefan Hajnoczi <hidden>
Date: 2019-07-01 15:09:36
Also in: kvm, lkml, virtualization

On Fri, Jun 28, 2019 at 02:36:59PM +0200, Stefano Garzarella wrote:
This patch moves the flush of works after vdev->config->del_vqs(vdev),
because we need to be sure that no workers run before to free the
'vsock' object.

Since we stopped the workers using the [tx|rx|event]_run flags,
we are sure no one is accessing the device while we are calling
vdev->config->reset(vdev), so we can safely move the workers' flush.

Before the vdev->config->del_vqs(vdev), workers can be scheduled
by VQ callbacks, so we must flush them after del_vqs(), to avoid
use-after-free of 'vsock' object.
Nevermind, I looked back at Patch 2 and saw the send_pkt and loopback
work functions were also updated.  Thanks!

Stefan

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help