mbox series

[kvmtool,0/4] Fix some undefined behaviour

Message ID 20220601165138.3135246-1-andre.przywara@arm.com (mailing list archive)
Headers show
Series Fix some undefined behaviour | expand

Message

Andre Przywara June 1, 2022, 4:51 p.m. UTC
Hi,

triggered by some integer overflow issues, discovered through Alex' "set
RAM base address" series, I enabled "-fsanitize=undefined
-fsanitize=address" in the Makefile, and enjoyed the fireworks.
This series is cheekily just picking the lowest hanging fruits:
Some needlessly unaligned accesses in the virtio-mmio code, and signed
shifts in the x86 CPUID code.
There are more issues, but they take more time fixing.

Please have a look!

Cheers,
Andre

Andre Przywara (4):
  virtio/mmio: avoid unaligned accesses
  virtio/mmio: access header members normally
  virtio/mmio: remove unneeded virtio_mmio_hdr members
  x86/cpuid: fix undefined behaviour

 include/kvm/virtio-mmio.h | 12 ++----------
 virtio/mmio.c             | 19 +++++++++++++++----
 x86/cpuid.c               |  6 +++---
 3 files changed, 20 insertions(+), 17 deletions(-)