aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke.mehrtens@intel.com>2020-02-12 11:48:59 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2020-02-22 16:34:57 +0100
commitd9b043c03c18e5a0e9ff5502880174ba2320a1bb (patch)
treedf7c096516122c6095f8fc36784c56e0968f318d /config
parentcbb6929789e6fd0f4f062a382b5a1ea0e97bf550 (diff)
downloadupstream-d9b043c03c18e5a0e9ff5502880174ba2320a1bb.tar.gz
upstream-d9b043c03c18e5a0e9ff5502880174ba2320a1bb.tar.bz2
upstream-d9b043c03c18e5a0e9ff5502880174ba2320a1bb.zip
build: Add option KERNEL_UBSAN
The kernel Undefined Behavior Sanitizer is able to detect some memory bugs in the kernel like out of range array accesses. Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Diffstat (limited to 'config')
-rw-r--r--config/Config-kernel.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index db17f6a9dd..e8bcf1970f 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -85,6 +85,41 @@ config KERNEL_PROFILING
Enable the extended profiling support mechanisms used by profilers such
as OProfile.
+config KERNEL_UBSAN
+ bool "Compile the kernel with 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
+ via boot parameter ubsan_handle
+ (see: Documentation/dev-tools/ubsan.rst).
+
+config KERNEL_UBSAN_SANITIZE_ALL
+ bool "Enable instrumentation for the entire kernel"
+ depends on KERNEL_UBSAN
+ 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.
+ Enabling this option will get kernel image size increased
+ significantly.
+
+config KERNEL_UBSAN_ALIGNMENT
+ bool "Enable checking of pointers alignment"
+ depends on KERNEL_UBSAN
+ help
+ This option enables detection of unaligned memory accesses.
+ Enabling this option on architectures that support unaligned
+ accesses may produce a lot of false positives.
+
+config KERNEL_UBSAN_NULL
+ bool "Enable checking of null pointers"
+ depends on KERNEL_UBSAN
+ help
+ This option enables detection of memory accesses via a
+ null pointer.
+
config KERNEL_TASKSTATS
bool "Compile the kernel with task resource/io statistics and accounting"
default n