Andrey Ryabinin | c6d3085 | 2016-01-20 15:00:55 -0800 | [diff] [blame] | 1 | config ARCH_HAS_UBSAN_SANITIZE_ALL |
| 2 | bool |
| 3 | |
| 4 | config UBSAN |
| 5 | bool "Undefined behaviour sanity checker" |
| 6 | help |
| 7 | This option enables undefined behaviour sanity checker |
| 8 | Compile-time instrumentation is used to detect various undefined |
| 9 | behaviours in runtime. Various types of checks may be enabled |
| 10 | via boot parameter ubsan_handle (see: Documentation/ubsan.txt). |
| 11 | |
| 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 | default y |
| 17 | help |
| 18 | This option activates instrumentation for the entire kernel. |
| 19 | If you don't enable this option, you have to explicitly specify |
| 20 | UBSAN_SANITIZE := y for the files/directories you want to check for UB. |
Yang Shi | 7707535 | 2016-02-11 16:12:55 -0800 | [diff] [blame] | 21 | Enabling this option will get kernel image size increased |
| 22 | significantly. |
Andrey Ryabinin | c6d3085 | 2016-01-20 15:00:55 -0800 | [diff] [blame] | 23 | |
| 24 | config UBSAN_ALIGNMENT |
| 25 | bool "Enable checking of pointers alignment" |
| 26 | depends on UBSAN |
| 27 | default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS |
| 28 | help |
| 29 | This option enables detection of unaligned memory accesses. |
Yang Shi | 7707535 | 2016-02-11 16:12:55 -0800 | [diff] [blame] | 30 | Enabling this option on architectures that support unaligned |
Andrey Ryabinin | c6d3085 | 2016-01-20 15:00:55 -0800 | [diff] [blame] | 31 | accesses may produce a lot of false positives. |