[Devel] [PATCH hci-8.1 1/2] Revert "drivers/vhost: add ioctl to increase the number of workers"

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Oct 27 14:42:36 MSK 2026


> This reverts commit 1491588e71dafc934c8d450ba36cc33bb0f990bd.
> 
> VHOST_SET_NWORKERS was a stopgap to run our userspace on the rh10
> kernel unchanged. Userspace should use the mainstream worker ioctls
> (VHOST_NEW_WORKER, VHOST_ATTACH_VRING_WORKER etc.) instead.
> 
> It is also unsafe next to those ioctls. vhost_set_workers() installs
> its workers into vq->worker bypassing __vhost_vq_attach_worker(), so
> their attachment_cnt stays 0. VHOST_FREE_WORKER then destroys such a
> worker while a virtqueue still points at it, and the next
> vhost_vq_work_queue() on that vq is a use-after-free. vhost-scsi
> exposes this to the device owner.
> 
> The 0x1F ioctl number is freed: VHOST_SET_NWORKERS now fails with
> -ENOTTY, so userspace that still issues it has to be updated
> together with this kernel.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-107537
> Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
> 
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261027113830.2927925-1-alexander.ivanov@virtuozzo.com?part=1




More information about the Devel mailing list