[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 14/19] parallels: Check maximum cluster size on creat
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 14/19] parallels: Check maximum cluster size on create |
Date: |
Mon, 26 Mar 2018 16:35:55 +0200 |
It's unclear what the real maximum cluster size is for the Parallels
format, but let's at least make sure that we don't get integer
overflows in our .bdrv_co_create implementation.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/parallels.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/parallels.c b/block/parallels.c
index e2515dec81..799215e079 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -526,6 +526,11 @@ static int coroutine_fn
parallels_co_create(BlockdevCreateOptions* opts,
cl_size = DEFAULT_CLUSTER_SIZE;
}
+ /* XXX What is the real limit here? This is an insanely large maximum. */
+ if (cl_size >= INT64_MAX / MAX_PARALLELS_IMAGE_FACTOR) {
+ error_setg(errp, "Cluster size is too large");
+ return -EINVAL;
+ }
if (total_size >= MAX_PARALLELS_IMAGE_FACTOR * cl_size) {
error_setg(errp, "Image size is too large for this cluster size");
return -E2BIG;
--
2.13.6
- [Qemu-block] [PULL 04/19] block/throttle: Remove protocol-related fields, (continued)
- [Qemu-block] [PULL 04/19] block/throttle: Remove protocol-related fields, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 07/19] qcow2: Reset free_cluster_index when allocating a new refcount block, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 10/19] qemu-iotests: Test vdi image creation with QMP, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 13/19] qemu-iotests: Test invalid resize on luks, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 11/19] qemu-iotests: Enable 025 for luks, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 15/19] qemu-iotests: Test parallels image creation with QMP, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 12/19] luks: Turn another invalid assertion into check, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 18/19] vhdx: Check for 4 GB maximum log size on creation, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 16/19] vhdx: Require power-of-two block size on create, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 17/19] vhdx: Don't use error_setg_errno() with constant errno, Kevin Wolf, 2018/03/26
- [Qemu-block] [PULL 14/19] parallels: Check maximum cluster size on create,
Kevin Wolf <=
- [Qemu-block] [PULL 19/19] qemu-iotests: Test vhdx image creation with QMP, Kevin Wolf, 2018/03/26
- Re: [Qemu-block] [Qemu-devel] [PULL 00/19] Block layer patches, Peter Maydell, 2018/03/27