[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL v2 24/34] qcow2: Avoid making the L1 table too big
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL v2 24/34] qcow2: Avoid making the L1 table too big |
Date: |
Wed, 13 Jul 2016 14:50:31 +0200 |
From: Max Reitz <address@hidden>
We refuse to open images whose L1 table we deem "too big". Consequently,
we should not produce such images ourselves.
Cc: address@hidden
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
[mreitz: Added QEMU_BUILD_BUG_ON()]
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2-cluster.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 6b92ce9..00c16dc 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -65,7 +65,8 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t
min_size,
}
}
- if (new_l1_size > INT_MAX / sizeof(uint64_t)) {
+ QEMU_BUILD_BUG_ON(QCOW_MAX_L1_SIZE > INT_MAX);
+ if (new_l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) {
return -EFBIG;
}
--
1.8.3.1
- Re: [Qemu-block] [Qemu-devel] [PULL v2 11/34] blockjob: Update description of the 'device' field in the QMP API, (continued)
- [Qemu-block] [PULL v2 13/34] raw-posix: Use qemu_dup, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 15/34] test-coroutine: prepare for the next patch, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 12/34] osdep: Introduce qemu_dup, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 18/34] block/qdev: Allow configuring WCE with qdev properties, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 17/34] block/qdev: Allow node name for drive properties, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 19/34] commit: Fix use of error handling policy, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 14/34] coroutine: use QSIMPLEQ instead of QTAILQ, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 22/34] block: Remove BB options from blockdev-add, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 16/34] coroutine: move entry argument to qemu_coroutine_create, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 24/34] qcow2: Avoid making the L1 table too big,
Kevin Wolf <=
- [Qemu-block] [PULL v2 20/34] block/qdev: Allow configuring rerror/werror with qdev properties, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 21/34] qemu-iotests: Test setting WCE with qdev, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 23/34] qemu-img: Use strerror() for generic resize error, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 25/34] qemu-io: Use correct range limitations, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 28/34] vmdk: fix metadata write regression, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 33/34] vvfat: Fix qcow write target driver specification, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 26/34] qcow2: Fix qcow2_get_cluster_offset(), Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 34/34] iotests: Make 157 actually format-agnostic, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 29/34] blockdev: Fix regression with the default naming of throttling groups, Kevin Wolf, 2016/07/13
- [Qemu-block] [PULL v2 31/34] hmp: use snapshot name to determine whether a snapshot is 'fully available', Kevin Wolf, 2016/07/13