[Devel] [PATCH RHEL10 COMMIT] vhost/vsock: don't purge send_pkt_queue on VHOST_RESET_OWNER #VSTOR-130976

Konstantin Khorenko khorenko at virtuozzo.com
Thu May 14 11:45:22 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-55.52.1.5.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.5.23.vz10
------>
commit 49e1a66e79864b4d92617675ca8850dc705e6a55
Author: Andrey Drobyshev <andrey.drobyshev at virtuozzo.com>
Date:   Tue May 12 19:07:49 2026 +0300

    vhost/vsock: don't purge send_pkt_queue on VHOST_RESET_OWNER #VSTOR-130976
    
    Commit 6ff9ad917553 ("vhost/vsock: add VHOST_RESET_OWNER ioctl") added
    support for VHOST_RESET_OWNER specifically to let QEMU hand
    /dev/vhost-vsock from a dying task to a freshly exec()ed one during
    qemu-update (cpr-exec), without tearing down in-flight AF_VSOCK
    connections.
    
    However, current implementation unconditionally calls
    
        virtio_vsock_skb_queue_purge(&vsock->send_pkt_queue);
    
    after vhost_dev_stop() in vhost_vsock_reset_owner().  The queue holds
    host<-->guest skbs submitted by the host kernel's AF_VSOCK layer.  Those
    skbs should be owned by the connection itself (which we're trying to
    preserve), not by the userspace task whose ownership is being reset.  The
    delivery of those packets is still required for the connections to remain
    consistent.
    
    Currently, with the queue being purged, we observe data loss (or even a
    deadlock) when performing qemu-update operation during data transfer
    through vhost-vsock channel.  Let's get rid of it here.  The purge still
    happens upon device release in vhost_vsock_dev_release(), so no skbs
    should be leaked here.
    
    Fixes: 6ff9ad917553 ("vhost/vsock: add VHOST_RESET_OWNER ioctl")
    https://virtuozzo.atlassian.net/browse/VSTOR-130976
    
    Signed-off-by: Andrey Drobyshev <andrey.drobyshev at virtuozzo.com>
    
    Feature: vhost-vsock: VHOST_RESET_OWNER ioctl
---
 drivers/vhost/vsock.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index fa9a528240803..edc15f7259262 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -857,7 +857,6 @@ static int vhost_vsock_reset_owner(struct vhost_vsock *vsock)
 	vhost_vsock_drop_backends(vsock);
 	vhost_vsock_flush(vsock);
 	vhost_dev_stop(&vsock->dev);
-	virtio_vsock_skb_queue_purge(&vsock->send_pkt_queue);
 	vhost_dev_reset_owner(&vsock->dev, umem);
 done:
 	mutex_unlock(&vsock->dev.mutex);


More information about the Devel mailing list