Skip to content

Fix some undefined behaviour

Andre Przywara kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4virtio/mmio: avoid unaligned accessesinclude/kvm/virtio-mmio.h+1 -10 replies
2/4virtio/mmio: access header members normallyinclude/kvm/virtio-mmio.h virtio/mmio.c+16 -52 replies
3/4virtio/mmio: remove unneeded virtio_mmio_hdr membersinclude/kvm/virtio-mmio.h+0 -80 replies
4/4x86/cpuid: fix undefined behaviourx86/cpuid.c+3 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH kvmtool 0/4] Fix some undefined behaviour

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(-)
Signature · 1 line
2.25.1