Kconfig.ubsan 1.5 KB

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