Re: [PATCH v2 0/2] vhost-scsi: fix max_io_vqs handling

Stefan Hajnoczi <[email protected]> Tue, 11 Aug 2026 09:51:27 -0400
Newsgroups dev.linux.lists.virtualization,org.kernel.vger.kvm
Message-ID <20260811135127.GB111558@fedora>
On Sun, Aug 02, 2026 at 10:24:54AM -0700, Dongli Zhang wrote:
> Avoid high-order kmalloc() allocations for the vhost-scsi virtqueue array,
> and clamp out-of-range max_io_vqs updates so the stored value remains
> within the supported range.
> 
> v1->v2:
>   - Access vhost_scsi_max_io_vqs with READ_ONCE().
>   - Clamp out-of-range max_io_vqs values instead of rejecting them.
> 
> Dongli Zhang (2):
>   vhost-scsi: use kvzalloc for vq array allocation
>   vhost-scsi: vhost-scsi: clamp max_io_vqs module parameter
> 
>  drivers/vhost/scsi.c | 49 ++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 36 insertions(+), 13 deletions(-)
> 
> base-commit: 2d2338c93da79b3bfe4b6099a931d9468d539952
> 
> Thank you very much!
> 
> Dongli Zhang
> 

Reviewed-by: Stefan Hajnoczi <[email protected]>
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmp7KN8ACgkQnKSrs4Gr
c8jvCQf9HiJAU4bwdawrjnhcxSCHUZMJhWY+MVdLPAvvOSoelfyU+dw9O7fvuEML
Z8OczANuafEbDrxUC6/9vqpEau/is7eC90IuL3slA+4fjiuzZlWXpfN8NWhjzQCC
i6CxCTRPstLWmUdDWKAq1ve4/Fz1whZ3xQJ9Rh1AwdNpi2Mnv8bDIU8RzCnERMlU
P8YJ8E1gCj/YgKbmFEtx3drGwj2Z2szfCOONjvsvgwq0YGNNDMrVMlY1qWF8h5FA
p6xvuKUj4SxM3u8UfDs8b8Tv5URIsGiLkNMozXeazoY0essTJuzVafeoSsHWSax+
VcZhy+jOE5nlg6n7BWLFHUsLPSut1A==
=aMFK
-----END PGP SIGNATURE-----