scripts: mkbootimg_rpi4: Fix url path to tizen_7.0
[platform/kernel/linux-rpi.git] / lib / Kconfig.kfence
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 config HAVE_ARCH_KFENCE
4         bool
5
6 menuconfig KFENCE
7         bool "KFENCE: low-overhead sampling-based memory safety error detector"
8         depends on HAVE_ARCH_KFENCE && (SLAB || SLUB)
9         depends on JUMP_LABEL # To ensure performance, require jump labels
10         select STACKTRACE
11         help
12           KFENCE is a low-overhead sampling-based detector of heap out-of-bounds
13           access, use-after-free, and invalid-free errors. KFENCE is designed
14           to have negligible cost to permit enabling it in production
15           environments.
16
17           See <file:Documentation/dev-tools/kfence.rst> for more details.
18
19           Note that, KFENCE is not a substitute for explicit testing with tools
20           such as KASAN. KFENCE can detect a subset of bugs that KASAN can
21           detect, albeit at very different performance profiles. If you can
22           afford to use KASAN, continue using KASAN, for example in test
23           environments. If your kernel targets production use, and cannot
24           enable KASAN due to its cost, consider using KFENCE.
25
26 if KFENCE
27
28 config KFENCE_SAMPLE_INTERVAL
29         int "Default sample interval in milliseconds"
30         default 100
31         help
32           The KFENCE sample interval determines the frequency with which heap
33           allocations will be guarded by KFENCE. May be overridden via boot
34           parameter "kfence.sample_interval".
35
36           Set this to 0 to disable KFENCE by default, in which case only
37           setting "kfence.sample_interval" to a non-zero value enables KFENCE.
38
39 config KFENCE_NUM_OBJECTS
40         int "Number of guarded objects available"
41         range 1 65535
42         default 255
43         help
44           The number of guarded objects available. For each KFENCE object, 2
45           pages are required; with one containing the object and two adjacent
46           ones used as guard pages.
47
48 config KFENCE_STRESS_TEST_FAULTS
49         int "Stress testing of fault handling and error reporting" if EXPERT
50         default 0
51         help
52           The inverse probability with which to randomly protect KFENCE object
53           pages, resulting in spurious use-after-frees. The main purpose of
54           this option is to stress test KFENCE with concurrent error reports
55           and allocations/frees. A value of 0 disables stress testing logic.
56
57           Only for KFENCE testing; set to 0 if you are not a KFENCE developer.
58
59 config KFENCE_KUNIT_TEST
60         tristate "KFENCE integration test suite" if !KUNIT_ALL_TESTS
61         default KUNIT_ALL_TESTS
62         depends on TRACEPOINTS && KUNIT
63         help
64           Test suite for KFENCE, testing various error detection scenarios with
65           various allocation types, and checking that reports are correctly
66           output to console.
67
68           Say Y here if you want the test to be built into the kernel and run
69           during boot; say M if you want the test to build as a module; say N
70           if you are unsure.
71
72 endif # KFENCE