All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] ubsan: Introduce wrap-around sanitizers
@ 2024-01-29 18:00 Kees Cook
  2024-01-29 18:00 ` [PATCH 1/6] ubsan: Use Clang's -fsanitize-trap=undefined option Kees Cook
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Kees Cook @ 2024-01-29 18:00 UTC (permalink / raw)
  To: Marco Elver
  Cc: Kees Cook, Justin Stitt, Fangrui Song, Nathan Chancellor,
	Masahiro Yamada, Bill Wendling, Nicolas Schier, Andrey Konovalov,
	linux-kernel, linux-kbuild, llvm, linux-hardening

Hi,

Lay the ground work for gaining instrumentation for signed[1],
unsigned[2], and pointer[3] wrap-around by making all 3 sanitizers
available for testing. Additionally gets x86_64 bootable under the
unsigned sanitizer for the first time.

The compilers will need work before this can be generally useful, as the
signed and pointer sanitizers are effectively a no-op with the kernel's
required use of -fno-strict-overflow. The unsigned sanitizer will also
need adjustment to deal with the many common code patterns that exist
for unsigned wrap-around (e.g. "while (var--)", "-1UL", etc).

-Kees

Link: https://github.com/KSPP/linux/issues/26 [1]
Link: https://github.com/KSPP/linux/issues/27 [2]
Link: https://github.com/KSPP/linux/issues/344 [3]

Kees Cook (6):
  ubsan: Use Clang's -fsanitize-trap=undefined option
  ubsan: Reintroduce signed and unsigned overflow sanitizers
  ubsan: Introduce CONFIG_UBSAN_POINTER_WRAP
  ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL
  ubsan: Split wrapping sanitizer Makefile rules
  ubsan: Get x86_64 booting with unsigned wrap-around sanitizer

 Documentation/dev-tools/ubsan.rst | 28 +++-------
 arch/arm/Kconfig                  |  2 +-
 arch/arm64/Kconfig                |  2 +-
 arch/mips/Kconfig                 |  2 +-
 arch/parisc/Kconfig               |  2 +-
 arch/powerpc/Kconfig              |  2 +-
 arch/riscv/Kconfig                |  2 +-
 arch/s390/Kconfig                 |  2 +-
 arch/x86/Kconfig                  |  2 +-
 arch/x86/kernel/Makefile          |  1 +
 arch/x86/kernel/apic/Makefile     |  1 +
 arch/x86/mm/Makefile              |  1 +
 arch/x86/mm/pat/Makefile          |  1 +
 crypto/Makefile                   |  1 +
 drivers/acpi/Makefile             |  1 +
 include/linux/compiler_types.h    | 19 ++++++-
 kernel/Makefile                   |  1 +
 kernel/locking/Makefile           |  1 +
 kernel/rcu/Makefile               |  1 +
 kernel/sched/Makefile             |  1 +
 lib/Kconfig.ubsan                 | 41 +++++++++-----
 lib/Makefile                      |  1 +
 lib/crypto/Makefile               |  1 +
 lib/crypto/mpi/Makefile           |  1 +
 lib/test_ubsan.c                  | 82 ++++++++++++++++++++++++++++
 lib/ubsan.c                       | 89 +++++++++++++++++++++++++++++++
 lib/ubsan.h                       |  5 ++
 lib/zlib_deflate/Makefile         |  1 +
 lib/zstd/Makefile                 |  2 +
 mm/Makefile                       |  1 +
 net/core/Makefile                 |  1 +
 net/ipv4/Makefile                 |  1 +
 scripts/Makefile.lib              | 11 +++-
 scripts/Makefile.ubsan            | 11 +++-
 34 files changed, 278 insertions(+), 43 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-01-29 20:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-29 18:00 [PATCH 0/6] ubsan: Introduce wrap-around sanitizers Kees Cook
2024-01-29 18:00 ` [PATCH 1/6] ubsan: Use Clang's -fsanitize-trap=undefined option Kees Cook
2024-01-29 18:59   ` Fangrui Song
2024-01-29 18:00 ` [PATCH 2/6] ubsan: Reintroduce signed and unsigned overflow sanitizers Kees Cook
2024-01-29 19:54   ` Justin Stitt
2024-01-29 20:22     ` Kees Cook
2024-01-29 18:00 ` [PATCH 3/6] ubsan: Introduce CONFIG_UBSAN_POINTER_WRAP Kees Cook
2024-01-29 18:00 ` [PATCH 4/6] ubsan: Remove CONFIG_UBSAN_SANITIZE_ALL Kees Cook
2024-01-29 18:00 ` [PATCH 5/6] ubsan: Split wrapping sanitizer Makefile rules Kees Cook
2024-01-29 18:00 ` [PATCH 6/6] ubsan: Get x86_64 booting with unsigned wrap-around sanitizer Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.