From: "Benoît Canet" <benoit.canet@irqsave.net>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, ppandit@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/5] qcow1: Make padding in the header explicit
Date: Mon, 12 May 2014 16:39:12 +0200 [thread overview]
Message-ID: <20140512143911.GD7858@irqsave.net> (raw)
In-Reply-To: <1399899851-5641-2-git-send-email-kwolf@redhat.com>
The Monday 12 May 2014 à 15:04:07 (+0200), Kevin Wolf wrote :
> 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.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> 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
>
>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
next prev parent reply other threads:[~2014-05-12 14:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 13:04 [Qemu-devel] [PATCH 0/5] qcow1: Input validation fixes Kevin Wolf
2014-05-12 13:04 ` [Qemu-devel] [PATCH 1/5] qcow1: Make padding in the header explicit Kevin Wolf
2014-05-12 14:39 ` Benoît Canet [this message]
2014-05-12 13:04 ` [Qemu-devel] [PATCH 2/5] qcow1: Check maximum cluster size Kevin Wolf
2014-05-12 15:00 ` Benoît Canet
2014-05-15 14:13 ` Kevin Wolf
2014-05-12 13:04 ` [Qemu-devel] [PATCH 3/5] qcow1: Validate L2 table size (CVE-2014-0222) Kevin Wolf
2014-05-12 15:09 ` Benoît Canet
2014-05-12 13:04 ` [Qemu-devel] [PATCH 4/5] qcow1: Validate image size (CVE-2014-0223) Kevin Wolf
2014-05-12 15:50 ` Benoît Canet
2014-05-12 16:43 ` Kevin Wolf
2014-05-12 17:04 ` Benoît Canet
2014-05-12 21:02 ` Benoît Canet
2014-05-13 8:41 ` Kevin Wolf
2014-05-12 13:04 ` [Qemu-devel] [PATCH 5/5] qcow1: Stricter backing file length check Kevin Wolf
2014-05-12 15:53 ` [Qemu-devel] [PATCH 5/5] qcow1: Stricter backing file length check* Benoît Canet
2014-05-13 13:08 ` [Qemu-devel] [PATCH 0/5] qcow1: Input validation fixes Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140512143911.GD7858@irqsave.net \
--to=benoit.canet@irqsave.net \
--cc=kwolf@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).