[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/32] qcow2: Avoid making the L1 table too big
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 24/32] qcow2: Avoid making the L1 table too big |
Date: |
Fri, 8 Jul 2016 19:21:36 +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
- [Qemu-devel] [PULL 08/32] stream: Add 'job-id' parameter to 'block-stream', (continued)
- [Qemu-devel] [PULL 08/32] stream: Add 'job-id' parameter to 'block-stream', Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 10/32] qemu-img: Set the ID of the block job in img_commit(), Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 20/32] block/qdev: Allow configuring rerror/werror with qdev properties, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 25/32] qemu-io: Use correct range limitations, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 09/32] commit: Add 'job-id' parameter to 'block-commit', Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 23/32] qemu-img: Use strerror() for generic resize error, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 26/32] qcow2: Fix qcow2_get_cluster_offset(), Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 21/32] qemu-iotests: Test setting WCE with qdev, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 11/32] blockjob: Update description of the 'device' field in the QMP API, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 22/32] block: Remove BB options from blockdev-add, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 24/32] qcow2: Avoid making the L1 table too big,
Kevin Wolf <=
- [Qemu-devel] [PULL 28/32] vmdk: fix metadata write regression, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 27/32] Improve block job rate limiting for small bandwidth values, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 16/32] coroutine: move entry argument to qemu_coroutine_create, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 29/32] blockdev: Fix regression with the default naming of throttling groups, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 30/32] qemu-iotests: Test naming of throttling groups, Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 31/32] hmp: use snapshot name to determine whether a snapshot is 'fully available', Kevin Wolf, 2016/07/08
- [Qemu-devel] [PULL 32/32] hmp: show all of snapshot info on every block dev in output of 'info snapshots', Kevin Wolf, 2016/07/08
- Re: [Qemu-devel] [PULL 00/32] Block layer patches, Peter Maydell, 2016/07/11