Re: [PATCH v3 6/7] hw/scsi/virtio-scsi: harden virtio_scsi_load_request() against invalid stream
Stefan Hajnoczi <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu.stable,gmane.comp.emulators.qemu,gmane.comp.emulators.qemu.block |
|---|---|
| Message-ID | <20260730133534.GA1442692@fedora> |
On Thu, Jul 30, 2026 at 01:19:03AM +0200, Laurent Vivier wrote: > virtio_scsi_load_request() uses assert() and exit(1) for conditions > that can be triggered by a crafted migration stream: an out-of-range > queue index, a malformed SCSI request, or a command mode mismatch. > > Replace these with proper error returns so the migration fails > gracefully instead of aborting the destination QEMU process. > > Cc: [email protected] > Fixes: 5db1764cc1f6 ("virtio-scsi: add migration support") > Fixes: d2ad7dd46e72 ("virtio-scsi: add multiqueue capability") > Fixes: 36b15c79aa1b ("virtio-scsi: start preparing for any_layout") > Signed-off-by: Laurent Vivier <[email protected]> > --- > > Notes: > v2: add error_setg() calls with descriptive error messages for > all three error paths > > hw/scsi/virtio-scsi.c | 21 ++++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) Reviewed-by: Stefan Hajnoczi <[email protected]>
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmprUyYACgkQnKSrs4Gr c8igeAgArYU4D8g5C1qn4dSnFaHq7o00BoZ6x4TzCKA+ep0zVsFqrwwHiUki6RrI 7ATIRZW7PdyMN155//PyGX2KQ7Iy7pSh2HrOuVbokNoLkm5LDOICqnZG86Cd60KQ 7CYl9IhEvdhEdatCs42jmXXrMfWFFTyqnrhsV+uu8JbTRo/whFhImRfmKquUAwih /J1Qy4pHnOQ/P8jSqQuUmofUL6u5XYF8JpICWpSSGyfQu3l+Uxe2vTTdur6GrGBe Wpk/SZQLUL0LqJOzOCr4uVvRUxfZ7qhAH8LTfj7yeQvpxbcsCCgUQt8mNUEIzb4K Xaj2Z07sGhhkMO5Zl4SNd2PjbWzbhg== =Yef0 -----END PGP SIGNATURE-----