mbox series

[0/7] x86/ubsan: fix ubsan on clang + code fixes

Message ID 20250313153029.93347-1-roger.pau@citrix.com (mailing list archive)
Headers show
Series x86/ubsan: fix ubsan on clang + code fixes | expand

Message

Roger Pau Monné March 13, 2025, 3:30 p.m. UTC
Hello,

This started as a series to fix UBSAN when using clang, and the first 2
patches do fix that.  Patch 3 fix an issue when using UBSAN on gcc 12.
Patch 4 improves the reporting of clang UB pointer arithmetics.

Finally patches 5 and 6 fix bugs in the code highlighted by the clang UB
pointer arithmetic detection: offset additions to NULL pointers and too
early usage of ioremap_wc().

Patch 7 was the original goal of the series: be able to enable UBSAN for
randconfig.

Thanks, Roger.

Roger Pau Monne (7):
  xen/ubsan: provide helper for clang's -fsanitize=function
  x86/wait: prevent duplicated assembly labels
  x86/dom0: placate GCC 12 compile-time errors with UBSAN and PVH_GUEST
  xen/ubsan: expand pointer overflow message printing
  x86/ioremap: prevent additions against the NULL pointer
  x86/vga: fix mapping of the VGA text buffer
  kconfig/randconfig: enable UBSAN for randconfig

 xen/Kconfig                        |   4 ++
 xen/Kconfig.debug                  |   2 +-
 xen/arch/x86/boot/x86_64.S         |  10 ++-
 xen/arch/x86/dmi_scan.c            |   7 +-
 xen/arch/x86/include/asm/config.h  |   5 ++
 xen/arch/x86/mm.c                  |   6 +-
 xen/arch/x86/setup.c               |   2 +-
 xen/common/ubsan/ubsan.c           |  31 +++++++-
 xen/common/ubsan/ubsan.h           |   5 ++
 xen/common/wait.c                  | 111 ++++++++++++++++++++---------
 xen/drivers/video/vga.c            |  11 ++-
 xen/tools/kconfig/allrandom.config |   1 -
 12 files changed, 144 insertions(+), 51 deletions(-)