All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org,
	Jeff Cody <codyprime@gmail.com>, Max Reitz <mreitz@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/vhdx: Don't take address of fields in packed structs
Date: Wed, 17 Oct 2018 16:36:43 +0200	[thread overview]
Message-ID: <20181017143643.GF31479@localhost.localdomain> (raw)
In-Reply-To: <20181016170938.29303-1-peter.maydell@linaro.org>

Am 16.10.2018 um 19:09 hat Peter Maydell geschrieben:
> Taking the address of a field in a packed struct is a bad idea, because
> it might not be actually aligned enough for that pointer type (and
> thus cause a crash on dereference on some host architectures). Newer
> versions of clang warn about this. Avoid the bug by not using the
> "modify in place" byte swapping functions.
> 
> There are a few places where the in-place swap function is
> used on something other than a packed struct field; we convert
> those anyway, for consistency.
> 
> Patch produced with scripts/coccinelle/inplace-byteswaps.cocci.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Usual disclaimer: produced with "make check" only, but purely
> automated conversion should be safe.

More relevant, qemu-iotests for vhdx passes, too. I don't think "make
check" would run any of the modified code.

Thanks, applied to the block branch

Kevin

  parent reply	other threads:[~2018-10-17 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16 17:09 [Qemu-devel] [PATCH] block/vhdx: Don't take address of fields in packed structs Peter Maydell
2018-10-17  9:32 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2018-10-17 14:36 ` Kevin Wolf [this message]
2018-11-05 14:44   ` [Qemu-devel] " Peter Maydell

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=20181017143643.GF31479@localhost.localdomain \
    --to=kwolf@redhat.com \
    --cc=codyprime@gmail.com \
    --cc=mreitz@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.