Blame view

lib/Kconfig.ubsan 1.66 KB
ec8f24b7f   Thomas Gleixner   treewide: Add SPD...
1
  # SPDX-License-Identifier: GPL-2.0-only
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
2
3
4
5
6
7
8
9
10
  config ARCH_HAS_UBSAN_SANITIZE_ALL
  	bool
  
  config UBSAN
  	bool "Undefined behaviour sanity checker"
  	help
  	  This option enables undefined behaviour sanity checker
  	  Compile-time instrumentation is used to detect various undefined
  	  behaviours in runtime. Various types of checks may be enabled
046255470   Andreas Platschek   Kconfig: lib/Kcon...
11
12
  	  via boot parameter ubsan_handle
  	  (see: Documentation/dev-tools/ubsan.rst).
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
13
14
15
16
17
  
  config UBSAN_SANITIZE_ALL
  	bool "Enable instrumentation for the entire kernel"
  	depends on UBSAN
  	depends on ARCH_HAS_UBSAN_SANITIZE_ALL
dde5cf39d   Andrey Ryabinin   ubsan: fix tree-w...
18
19
20
21
22
  
  	# We build with -Wno-maybe-uninitilzed, but we still want to
  	# use -Wmaybe-uninitilized in allmodconfig builds.
  	# So dependsy bellow used to disable this option in allmodconfig
  	depends on !COMPILE_TEST
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
23
24
25
26
27
  	default y
  	help
  	  This option activates instrumentation for the entire kernel.
  	  If you don't enable this option, you have to explicitly specify
  	  UBSAN_SANITIZE := y for the files/directories you want to check for UB.
7707535ab   Yang Shi   ubsan: cosmetic f...
28
29
  	  Enabling this option will get kernel image size increased
  	  significantly.
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
30

1a6a1dbeb   Anders Roxell   lib/ubsan: defaul...
31
32
  config UBSAN_NO_ALIGNMENT
  	bool "Disable checking of pointers alignment"
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
33
  	depends on UBSAN
1a6a1dbeb   Anders Roxell   lib/ubsan: defaul...
34
  	default y if HAVE_EFFICIENT_UNALIGNED_ACCESS
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
35
  	help
1a6a1dbeb   Anders Roxell   lib/ubsan: defaul...
36
37
38
  	  This option disables the check of unaligned memory accesses.
  	  This option should be used when building allmodconfig.
  	  Disabling this option on architectures that support unaligned
c6d308534   Andrey Ryabinin   UBSAN: run-time u...
39
  	  accesses may produce a lot of false positives.
725c4d22b   Christian Borntraeger   ubsan: allow to d...
40

1a6a1dbeb   Anders Roxell   lib/ubsan: defaul...
41
42
  config UBSAN_ALIGNMENT
  	def_bool !UBSAN_NO_ALIGNMENT
854686f4e   Jinbum Park   lib: add testing ...
43
44
45
46
47
48
  config TEST_UBSAN
  	tristate "Module for testing for undefined behavior detection"
  	depends on m && UBSAN
  	help
  	  This is a test module for UBSAN.
  	  It triggers various undefined behavior, and detect it.