[PATCH] vhost: fix wrapping on control virtqueue rings

Maxime Coquelin maxime.coquelin at redhat.com
Fri May 16 16:14:23 CEST 2025



On 4/2/25 8:53 AM, David Marchand wrote:
> The idx field of a virtqueue available ring is increased by the driver
> regardless of the ring size. It is for the device to mask this index
> modulo the ring size (2.7.6 of the virtio 1.3 specification).
> The same applies to the used ring.
> 
> Failing to mask triggers:
> - crashes when popping message received on the cvq,
> - system lockups (in the case of VDUSE) when the virtio-net driver waits
>    infinitely,
> 
> Fixes: 474f4d7840ad ("vhost: add control virtqueue")
> Cc: stable at dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
>   lib/vhost/virtio_net_ctrl.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
> 

Applied to next-virtio/for-net-next.

Thanks,
Maxime



More information about the dev mailing list