Re: [Qemu-devel] [PATCH] qcow2: avoid misaligned 64bit bswap

2015-11-04 Thread Kevin Wolf
Am 03.11.2015 um 00:46 hat Eric Blake geschrieben: > On 11/02/2015 04:32 PM, John Snow wrote: > > If we create a buffer directly on the stack by using 12 bytes, there's > > no guarantee the 64bit value we want to swap will be aligned, which > > could cause errors with undefined behavior. > > > > S

Re: [Qemu-devel] [PATCH] qcow2: avoid misaligned 64bit bswap

2015-11-02 Thread Eric Blake
On 11/02/2015 04:32 PM, John Snow wrote: > If we create a buffer directly on the stack by using 12 bytes, there's > no guarantee the 64bit value we want to swap will be aligned, which > could cause errors with undefined behavior. > > Spotted with clang -fsanitize=undefined and observed in iotests

[Qemu-devel] [PATCH] qcow2: avoid misaligned 64bit bswap

2015-11-02 Thread John Snow
If we create a buffer directly on the stack by using 12 bytes, there's no guarantee the 64bit value we want to swap will be aligned, which could cause errors with undefined behavior. Spotted with clang -fsanitize=undefined and observed in iotests 15, 26, 44, 115 and 121. Signed-off-by: John Snow