Commit 8a91c8327c (hw/scsi: validate IU buffer bounds in vscsi_preprocess_desc())
made vscsi_queue_cmd() cancel the request when vscsi_preprocess_desc()
fails. However, scsi_req_cancel() does not send an SRP response by
itself. That is to be sent from vscsi_request_cancelled(), only when
req->dma_error is set, which was missed in the above mentioned commit.
Fixing that in this commit, preventing the guest from hanging until
timeout.
Fixes: 8a91c8327cc8 ("hw/scsi: validate IU buffer bounds in vscsi_preprocess_desc()")
Suggested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Chinmay Rath <rathc@linux.ibm.com>
---
hw/scsi/spapr_vscsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index 1283590844..466f6d99e6 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -854,6 +854,7 @@ static int vscsi_queue_cmd(VSCSIState *s, vscsi_req *req)
/* Preprocess RDMA descriptors */
if (vscsi_preprocess_desc(req) < 0) {
+ req->dma_error = true;
scsi_req_cancel(req->sreq);
return 1;
}
--
2.56.1