qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/iscsi: avoid potential overflow of acb->task->cdb
@ 2016-05-24  8:59 Peter Lieven
  2016-05-31  6:44 ` Fam Zheng
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Lieven @ 2016-05-24  8:59 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, pbonzini, famz, Peter Lieven, qemu-stable

at least in the path via virtio-blk the maximum size is not
restricted.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
---
 block/iscsi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index 2ca8e72..e7d5f7b 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -833,6 +833,13 @@ static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs,
         return &acb->common;
     }
 
+    if (acb->ioh->cmd_len > SCSI_CDB_MAX_SIZE) {
+        error_report("iSCSI: ioctl error CDB exceeds max size (%d > %d)",
+                     acb->ioh->cmd_len, SCSI_CDB_MAX_SIZE);
+        qemu_aio_unref(acb);
+        return NULL;
+    }
+
     acb->task = malloc(sizeof(struct scsi_task));
     if (acb->task == NULL) {
         error_report("iSCSI: Failed to allocate task for scsi command. %s",
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-31  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24  8:59 [Qemu-devel] [PATCH] block/iscsi: avoid potential overflow of acb->task->cdb Peter Lieven
2016-05-31  6:44 ` Fam Zheng
2016-05-31  7:35   ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-05-31  8:01     ` Fam Zheng
2016-05-31  7:39   ` Kevin Wolf
2016-05-31  8:03     ` Fam Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).