Kconfig.ubsan 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. config ARCH_HAS_UBSAN_SANITIZE_ALL
  2. bool
  3. config UBSAN
  4. bool "Undefined behaviour sanity checker"
  5. help
  6. This option enables undefined behaviour sanity checker
  7. Compile-time instrumentation is used to detect various undefined
  8. behaviours in runtime. Various types of checks may be enabled
  9. via boot parameter ubsan_handle
  10. (see: Documentation/dev-tools/ubsan.rst).
  11. config UBSAN_SANITIZE_ALL
  12. bool "Enable instrumentation for the entire kernel"
  13. depends on UBSAN
  14. depends on ARCH_HAS_UBSAN_SANITIZE_ALL
  15. # We build with -Wno-maybe-uninitilzed, but we still want to
  16. # use -Wmaybe-uninitilized in allmodconfig builds.
  17. # So dependsy bellow used to disable this option in allmodconfig
  18. depends on !COMPILE_TEST
  19. default y
  20. help
  21. This option activates instrumentation for the entire kernel.
  22. If you don't enable this option, you have to explicitly specify
  23. UBSAN_SANITIZE := y for the files/directories you want to check for UB.
  24. Enabling this option will get kernel image size increased
  25. significantly.
  26. config UBSAN_ALIGNMENT
  27. bool "Enable checking of pointers alignment"
  28. depends on UBSAN
  29. default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS
  30. help
  31. This option enables detection of unaligned memory accesses.
  32. Enabling this option on architectures that support unaligned
  33. accesses may produce a lot of false positives.
  34. config TEST_UBSAN
  35. tristate "Module for testing for undefined behavior detection"
  36. depends on m && UBSAN
  37. help
  38. This is a test module for UBSAN.
  39. It triggers various undefined behavior, and detect it.