[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/22] qcow1: Make padding in the header explicit
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 15/22] qcow1: Make padding in the header explicit |
Date: |
Mon, 19 May 2014 16:22:33 +0200 |
We were relying on all compilers inserting the same padding in the
header struct that is used for the on-disk format. Let's not do that.
Mark the struct as packed and insert an explicit padding field for
compatibility.
Cc: address@hidden
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
---
block/qcow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/qcow.c b/block/qcow.c
index 937dd6d..3684794 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -48,9 +48,10 @@ typedef struct QCowHeader {
uint64_t size; /* in bytes */
uint8_t cluster_bits;
uint8_t l2_bits;
+ uint16_t padding;
uint32_t crypt_method;
uint64_t l1_table_offset;
-} QCowHeader;
+} QEMU_PACKED QCowHeader;
#define L2_CACHE_SIZE 16
--
1.8.3.1
- [Qemu-devel] [PULL 04/22] block: add test for vhdx image created by Disk2VHD, (continued)
- [Qemu-devel] [PULL 04/22] block: add test for vhdx image created by Disk2VHD, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 01/22] block: Fix bdrv_is_allocated() for short backing files, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 03/22] block: vhdx - account for identical header sections, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 08/22] iotests: Add test for the JSON protocol, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 09/22] qemu-iotests: Fix core dump suppression in test 039, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 07/22] block: Allow JSON filenames, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 10/22] qemu-iotests: Fix blkdebug in VM drive in 030, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 14/22] curl: Add usage documentation, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 12/22] curl: Remove broken parsing of options from url, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 11/22] curl: Fix build when curl_multi_socket_action isn't available, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 15/22] qcow1: Make padding in the header explicit,
Kevin Wolf <=
- [Qemu-devel] [PULL 16/22] qcow1: Check maximum cluster size, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 13/22] curl: Add sslverify option, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 17/22] qcow1: Validate L2 table size (CVE-2014-0222), Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 19/22] qcow1: Stricter backing file length check, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 18/22] qcow1: Validate image size (CVE-2014-0223), Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 20/22] util: add qemu_iovec_is_zero, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 21/22] blockdev: add a function to parse enum ids from strings, Kevin Wolf, 2014/05/19
- [Qemu-devel] [PULL 22/22] block: optimize zero writes with bdrv_write_zeroes, Kevin Wolf, 2014/05/19
- Re: [Qemu-devel] [PULL 00/22] Block patches, Peter Maydell, 2014/05/22