Revision 091901841af285f963ea80cd18d616fd0350ddbc authored by Peter Maydell on 16 October 2018, 17:25:03 UTC, committed by Kevin Wolf on 05 November 2018, 14:09:54 UTC
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. There are other places where we take the address of a packed member in this file for other purposes than passing it to a byteswap function (all the calls to qemu_uuid_*()); we leave those for now. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
1 parent 1229e46
File | Mode | Size |
---|---|---|
Makefile.objs | -rw-r--r-- | 468 bytes |
cryptodev-builtin.c | -rw-r--r-- | 12.0 KB |
cryptodev-vhost-user.c | -rw-r--r-- | 10.8 KB |
cryptodev-vhost.c | -rw-r--r-- | 8.7 KB |
cryptodev.c | -rw-r--r-- | 6.9 KB |
hostmem-file.c | -rw-r--r-- | 6.5 KB |
hostmem-memfd.c | -rw-r--r-- | 5.3 KB |
hostmem-ram.c | -rw-r--r-- | 1.3 KB |
hostmem.c | -rw-r--r-- | 13.6 KB |
rng-egd.c | -rw-r--r-- | 4.1 KB |
rng-random.c | -rw-r--r-- | 3.6 KB |
rng.c | -rw-r--r-- | 3.4 KB |
tpm.c | -rw-r--r-- | 4.5 KB |
Computing file changes ...