[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/40] block/iscsi: validate block size returned fro
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 04/40] block/iscsi: validate block size returned from target |
Date: |
Wed, 21 Oct 2015 12:51:34 -0500 |
From: Peter Lieven <address@hidden>
It has been reported that at least tgtd returns a block size of 0
for LUN 0. To avoid running into divide by zero later on and protect
against other problematic block sizes validate the block size right
at connection time.
Cc: address@hidden
Reported-by: Andrey Korolyov <address@hidden>
Signed-off-by: Peter Lieven <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit 6d1f252d8c1ba73bf6ed9af28731a9c9c3d473a2)
Signed-off-by: Michael Roth <address@hidden>
---
block/iscsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index 5002916..93f1ee4 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1214,6 +1214,10 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun,
Error **errp)
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
error_setg(errp, "iSCSI: failed to send readcapacity10 command.");
+ } else if (!iscsilun->block_size ||
+ iscsilun->block_size % BDRV_SECTOR_SIZE) {
+ error_setg(errp, "iSCSI: the target returned an invalid "
+ "block size of %d.", iscsilun->block_size);
}
if (task) {
scsi_free_scsi_task(task);
--
1.9.1
- [Qemu-devel] [PATCH 32/40] vmxnet3: Drop net_vmxnet3_info.can_receive, (continued)
- [Qemu-devel] [PATCH 32/40] vmxnet3: Drop net_vmxnet3_info.can_receive, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 30/40] virtio: avoid leading underscores for helpers, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 35/40] Revert "qdev: Use qdev_get_device_class() for -device <type>, help", Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 33/40] qmp: Fix device-list-properties not to crash for abstract device, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 34/40] qdev: Protect device-list-properties against broken devices, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 37/40] s390x/kvm: Fix vector validity bit in device machine checks, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 36/40] misc: zynq_slcr: Fix MMIO writes, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 38/40] util/qemu-config: fix missing machine command line options, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 40/40] virtio-input: ignore events until the guest driver is ready, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 39/40] Migration: Generate the completed event only when we complete, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 04/40] block/iscsi: validate block size returned from target,
Michael Roth <=
- [Qemu-devel] [PATCH 03/40] target-arm/arm-semi.c: Fix broken SYS_WRITE0 via gdb, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 05/40] exec-all: Translate TCI return addresses backwards too, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 06/40] block/nfs: fix calculation of allocated file size, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 07/40] qemu-img: Fix crash in amend invocation, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 08/40] mac_dbdma: always clear FLUSH bit once DBDMA channel flush is complete, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 10/40] scripts/dump-guest-memory.py: fix after RAMBlock change, Michael Roth, 2015/10/21
- [Qemu-devel] [PATCH 09/40] vhost-scsi: fix wrong vhost-scsi firmware path, Michael Roth, 2015/10/21
- Re: [Qemu-devel] [PATCH 00/40] Patch Round-up for stable 2.4.1, freeze on 2015-10-29, Cole Robinson, 2015/10/22