]> git.proxmox.com Git - mirror_qemu.git/commit
virtio: do not take address of packed members
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Sep 2018 21:17:42 +0000 (23:17 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 27 Mar 2019 05:57:37 +0000 (00:57 -0500)
commitce2c15fdafa18bb6262dc79e527ebdb78a9671df
tree133d96c2cf7d927f2491785aad7eb3d305989596
parent15f40e2e630aad28283d9834517406c219a5228d
virtio: do not take address of packed members

The address of a packed member is not packed, which may cause accesses
to unaligned pointers.  Avoid this by reading the packed value before
passing it to another function.

Cc: Jason Wang <jasowang@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit d41ca5afe3bc513ecf10b3ba5aa59523e3cd54aa)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/char/virtio-serial-bus.c