qemu/block
Eric Blake 2379ac134a iscsi: Avoid potential for get_status overflow
Detected by Coverity: Multiplying two 32-bit int and assigning
the result to a 64-bit number is a risk of overflow.  Prior to
the conversion to byte-based interfaces, the block layer took
care of ensuring that a status request never exceeded 2G in
the driver; but after that conversion, the block layer expects
drivers to deal with any size request (the driver can always
truncate the request size back down, as long as it makes
progress).  So, in the off-chance that someone makes a large
request, we are at the mercy of whether iscsi_get_lba_status_task()
will cap things to at most INT_MAX / iscsilun->block_size when
it populates lbasd->num_blocks; since I could not easily audit
that, it's better to be safe than sorry by just forcing a 64-bit
multiply.

Fixes: 92809c36
CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180508212718.1482663-1-eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
(cherry picked from commit 8ee1cef459)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2018-07-18 16:10:48 -05:00
..
accounting.c block/accounting: introduce latency histogram 2018-03-19 14:58:37 -05:00
backup.c blockjobs: ensure abort is called for cancelled jobs 2018-03-19 12:01:24 +01:00
blkdebug.c block: Switch passthrough drivers to .bdrv_co_block_status() 2018-03-02 18:39:07 +01:00
blkreplay.c block/blkreplay: Remove protocol-related fields 2018-03-26 12:16:00 +02:00
blkverify.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
block-backend.c block: let blk_add/remove_aio_context_notifier() tolerate BDS changes 2018-03-13 15:38:55 -05:00
bochs.c block: Deprecate bdrv_set_read_only() and users 2017-11-17 13:35:59 +01:00
cloop.c block: Deprecate bdrv_set_read_only() and users 2017-11-17 13:35:59 +01:00
commit.c commit/stream: Reset delay_ns 2018-04-10 16:33:47 +02:00
create.c block: x-blockdev-create QMP command 2018-03-09 15:17:47 +01:00
crypto.c luks: Turn another invalid assertion into check 2018-03-26 12:17:40 +02:00
crypto.h qcow: convert QCow to use QCryptoBlock for encryption 2017-07-11 17:44:56 +02:00
curl.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
dirty-bitmap.c dirty-bitmap: add locked state 2018-03-13 17:05:00 -04:00
dmg-bz2.c dmg: Move libbz2 code to dmg-bz2.so 2016-10-07 14:14:06 +02:00
dmg.c block: Deprecate bdrv_set_read_only() and users 2017-11-17 13:35:59 +01:00
dmg.h block: remove "qemu/osdep.h" from header file 2017-12-18 17:07:02 +03:00
file-posix.c block/file-posix: Fix fully preallocated truncate 2018-04-03 17:39:37 +02:00
file-win32.c file-win32: Support .bdrv_co_create 2018-03-09 15:17:47 +01:00
gluster.c gluster: Fix blockdev-add with server.N.type=unix 2018-04-03 09:57:14 -04:00
io.c coroutine: avoid co_queue_wakeup recursion 2018-03-27 13:05:28 +01:00
iscsi-opts.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
iscsi.c iscsi: Avoid potential for get_status overflow 2018-07-18 16:10:48 -05:00
linux-aio.c block: explicitly acquire aiocontext in aio callbacks that need it 2017-02-21 11:39:39 +00:00
Makefile.objs block: x-blockdev-create QMP command 2018-03-09 15:17:47 +01:00
mirror.c block/mirror: Make cancel always cancel pre-READY 2018-07-11 11:48:21 -05:00
nbd-client.c nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply 2018-07-11 11:48:22 -05:00
nbd-client.h nbd: BLOCK_STATUS for standard get_block_status function: client part 2018-03-13 15:43:48 -05:00
nbd.c nbd: BLOCK_STATUS for standard get_block_status function: client part 2018-03-13 15:43:48 -05:00
nfs.c nfs: Remove processed options from QDict 2018-07-18 11:10:19 -05:00
null.c null: Switch to .bdrv_co_block_status() 2018-03-02 18:39:07 +01:00
nvme.c qdict: remove useless cast 2018-03-27 10:17:32 -05:00
parallels.c parallels: Check maximum cluster size on create 2018-03-26 12:17:43 +02:00
parallels.h Clean up includes 2018-02-09 05:05:11 +01:00
qapi.c qapi: add block latency histogram interface 2018-03-19 14:58:38 -05:00
qcow.c qapi: Replace qobject_to_X(o) by qobject_to(X, o) 2018-03-19 14:58:36 -05:00
qcow2-bitmap.c qcow2-bitmap: add qcow2_reopen_bitmaps_rw_hint() 2018-03-26 21:17:24 +02:00
qcow2-cache.c qcow2: Allow configuring the L2 slice size 2018-02-13 17:00:00 +01:00
qcow2-cluster.c qcow2: Check L1 table parameters in qcow2_expand_zero_clusters() 2018-03-09 15:17:47 +01:00
qcow2-refcount.c qcow2: Reset free_cluster_index when allocating a new refcount block 2018-03-26 12:16:00 +02:00
qcow2-snapshot.c qcow2: Check snapshot L1 table in qcow2_snapshot_delete() 2018-03-09 15:17:47 +01:00
qcow2.c qcow2: Do not mark inactive images corrupt 2018-07-11 11:48:19 -05:00
qcow2.h qcow2: try load bitmaps only once 2018-04-16 13:35:32 +02:00
qed-check.c block: convert bdrv_check callback to coroutine_fn 2018-03-09 15:17:47 +01:00
qed-cluster.c qed: protect table cache with CoMutex 2017-07-17 11:34:11 +08:00
qed-l2-cache.c qed: protect table cache with CoMutex 2017-07-17 11:34:11 +08:00
qed-table.c block: convert bdrv_check callback to coroutine_fn 2018-03-09 15:17:47 +01:00
qed.c qapi: Replace qobject_to_X(o) by qobject_to(X, o) 2018-03-19 14:58:36 -05:00
qed.h qed: protect table cache with CoMutex 2017-07-17 11:34:11 +08:00
quorum.c block/quorum: Remove protocol-related fields 2018-03-26 12:16:00 +02:00
raw-format.c raw: Check byte range uniformly 2018-07-11 11:48:17 -05:00
rbd.c block/rbd: remove processed options from qdict 2018-04-04 12:05:13 -04:00
replication.c block/replication: Remove protocol_name field 2018-03-26 12:16:00 +02:00
sheepdog.c qapi: Replace qobject_to_X(o) by qobject_to(X, o) 2018-03-19 14:58:36 -05:00
snapshot.c Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
ssh.c ssh: Support .bdrv_co_create 2018-03-09 15:17:48 +01:00
stream.c commit/stream: Reset delay_ns 2018-04-10 16:33:47 +02:00
throttle-groups.c Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
throttle.c throttle: Fix crash on reopen 2018-07-11 11:48:20 -05:00
trace-events blockjobs: add block-job-finalize 2018-03-19 12:01:24 +01:00
vdi.c vdi: Fix build with CONFIG_VDI_DEBUG 2018-03-26 12:16:12 +02:00
vhdx-endian.c vhdx: Use QEMU UUID API 2016-09-23 11:42:52 +08:00
vhdx-log.c vhdx: use QEMU_ALIGN_DOWN 2017-08-31 12:29:07 +02:00
vhdx.c vhdx: Check for 4 GB maximum log size on creation 2018-03-26 12:17:43 +02:00
vhdx.h block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec 2014-12-12 15:42:22 +00:00
vmdk.c vmdk: return ERROR when cluster sector is larger than vmdk limitation 2018-03-26 21:17:24 +02:00
vpc.c qapi: Replace qobject_to_X(o) by qobject_to(X, o) 2018-03-19 14:58:36 -05:00
vvfat.c vvfat: Fix inherit_options flags 2018-03-19 12:01:39 +01:00
vxhs.c qobject: Use simpler QDict/QList scalar insertion macros 2017-05-09 09:13:51 +02:00
win32-aio.c block: explicitly acquire aiocontext in aio callbacks that need it 2017-02-21 11:39:39 +00:00
write-threshold.c Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00