[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 17/25] qcow2: reject unaligned offsets in write compr
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 17/25] qcow2: reject unaligned offsets in write compressed |
Date: |
Fri, 17 Nov 2017 19:16:45 +0100 |
From: Anton Nefedov <address@hidden>
Misaligned compressed write is not supported.
Signed-off-by: Anton Nefedov <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/qcow2.c b/block/qcow2.c
index f2731a7cb5..811b913233 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3358,6 +3358,10 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs,
uint64_t offset,
return bdrv_truncate(bs->file, cluster_offset, PREALLOC_MODE_OFF,
NULL);
}
+ if (offset_into_cluster(s, offset)) {
+ return -EINVAL;
+ }
+
buf = qemu_blockalign(bs, s->cluster_size);
if (bytes != s->cluster_size) {
if (bytes > s->cluster_size ||
--
2.13.6
- [Qemu-block] [PULL 08/25] iotests: test clearing unknown autoclear_features by qcow2, (continued)
- [Qemu-block] [PULL 08/25] iotests: test clearing unknown autoclear_features by qcow2, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 11/25] qapi/qlist: Add qlist_append_null() macro, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 10/25] qapi/qnull: Add own header, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 12/25] qapi: Add qobject_is_equal(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 13/25] block: qobject_is_equal() in bdrv_reopen_prepare(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 09/25] qcow2: fix image corruption on commit with persistent bitmap, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 14/25] iotests: Add test for non-string option reopening, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 16/25] iotests: Add test for failing qemu-img commit, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 19/25] qcow2: Unaligned zero cluster in handle_alloc(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 15/25] tests: Add check-qobject for equality tests, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 17/25] qcow2: reject unaligned offsets in write compressed,
Kevin Wolf <=
- [Qemu-block] [PULL 18/25] qcow2: check_errors are fatal, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 23/25] qcow2: Fix overly broad madvise(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 20/25] block: Guard against NULL bs->drv, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 22/25] qcow2: Refuse to get unaligned offsets from cache, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 21/25] qcow2: Add bounds check to get_refblock_offset(), Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 25/25] iotests: Make 087 pass without AIO enabled, Kevin Wolf, 2017/11/17
- [Qemu-block] [PULL 24/25] block: Make bdrv_next() keep strong references, Kevin Wolf, 2017/11/17
- Re: [Qemu-block] [Qemu-devel] [PULL 00/25] Block layer patches for 2.11.0-rc2, Peter Maydell, 2017/11/20