qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed str


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH] nbd: Don't take address of fields in packed structs
Date: Thu, 27 Sep 2018 22:24:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 9/27/18 7:16 PM, Eric Blake wrote:
> On 9/27/18 11:42 AM, Peter Maydell wrote:
>> 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.

Good cleaning.

>>
>> This patch was produced with the following spatch script:
> 
> 
> Will queue through my NBD tree.
> 
>>
>> Signed-off-by: Peter Maydell <address@hidden>
>> ---
>> Disclaimer: tested only with "make check", but it is a mechanically
>> generated patch...
>>
> 
> Reviewed-by: Eric Blake <address@hidden>
> 
> Conflicts with my pending NBD pull request, but I can touch that up (and
> ensure that it gets more than just compile-time testing, even though I
> agree that the change is safe from a pure review standpoint).
> 

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]