[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] block/vhdx: Don't take address of fields in pac
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] block/vhdx: Don't take address of fields in packed structs |
Date: |
Mon, 5 Nov 2018 14:44:34 +0000 |
On 17 October 2018 at 15:36, Kevin Wolf <address@hidden> wrote:
> 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 <address@hidden>
>> ---
>> 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
Ping? This doesn't seem to have reached master.
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH] block/vhdx: Don't take address of fields in packed structs,
Peter Maydell <=