netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/5] vhost/vsock: add support for VHOST_RESET_OWNER and CPR migration
@ 2026-07-14 15:16 Andrey Drobyshev
  2026-07-14 15:16 ` [PATCH v4 1/5] vhost/vsock: split out vhost_vsock_drop_backends helper Andrey Drobyshev
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Andrey Drobyshev @ 2026-07-14 15:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: kvm, virtualization, netdev, sgarzare, mst, stefanha,
	dongli.zhang, maciej.szmigiero, bchaney, mark.kanda, ptikhomirov,
	den, andrey.drobyshev

The main change since v3: as suggested by Stefano, the worker teardown
race is now fixed where it actually lives, i.e. in vhost_workers_free(),
instead of being guarded from the vsock side.  The new patch 4 makes the
teardown wait out the RCU readers which might still be queueing work on
a worker, and then run whatever they queued, before the workers are
freed.

With the teardown itself made safe, queueing work on a stopped device
is harmless again: the work handlers check the backend under vq->mutex
and simply return.  So the backend guards in send_pkt()/cancel_pkt()
and the synchronize_rcu() in reset_owner() from v3 are no longer needed
and are gone.

v3 -> v4:

  * Patch 2:
    - rename 'started' -> 'ever_started';
    - reword commit message;
  * Patch 3: reword commit message and code comment;
  * Patch 4 (NEW) ("vhost: synchronize with RCU readers when freeing workers"):
    - fix the vq->worker UAF and the stuck VHOST_WORK_QUEUED bit
      generically in vhost_workers_free();
  * Patch 4 -> 5 ("vhost/vsock: add VHOST_RESET_OWNER ioctl"):
    - drop the backend guards in send_pkt()/cancel_pkt() and the
      synchronize_rcu() in reset_owner() - covered by patch 4 now;
    - make vhost_vsock_reset_owner() return long;
    - reword commit message.

v3: https://lore.kernel.org/virtualization/20260625155416.480669-1-andrey.drobyshev@virtuozzo.com

Andrey Drobyshev (3):
  vhost/vsock: suppress EHOSTUNREACH fast-fail during CPR pause
  vhost/vsock: re-scan TX virtqueue on device start
  vhost: synchronize with RCU readers when freeing workers

Pavel Tikhomirov (2):
  vhost/vsock: split out vhost_vsock_drop_backends helper
  vhost/vsock: add VHOST_RESET_OWNER ioctl

 drivers/vhost/vhost.c | 15 ++++++++++
 drivers/vhost/vsock.c | 80 +++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 76 insertions(+), 19 deletions(-)

-- 
2.47.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-20  8:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 15:16 [PATCH v4 0/5] vhost/vsock: add support for VHOST_RESET_OWNER and CPR migration Andrey Drobyshev
2026-07-14 15:16 ` [PATCH v4 1/5] vhost/vsock: split out vhost_vsock_drop_backends helper Andrey Drobyshev
2026-07-14 15:16 ` [PATCH v4 2/5] vhost/vsock: suppress EHOSTUNREACH fast-fail during CPR pause Andrey Drobyshev
2026-07-14 15:16 ` [PATCH v4 3/5] vhost/vsock: re-scan TX virtqueue on device start Andrey Drobyshev
2026-07-14 15:16 ` [PATCH v4 4/5] vhost: synchronize with RCU readers when freeing workers Andrey Drobyshev
2026-07-16  8:57   ` Stefano Garzarella
2026-07-16 15:39     ` Andrey Drobyshev
2026-07-16 16:13       ` Stefano Garzarella
2026-07-16 18:01         ` Andrey Drobyshev
2026-07-20  8:39           ` Stefano Garzarella
2026-07-14 15:16 ` [PATCH v4 5/5] vhost/vsock: add VHOST_RESET_OWNER ioctl Andrey Drobyshev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).