diff options
author | Alexander Potapenko <glider@google.com> | 2019-07-16 19:27:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-16 22:23:22 -0400 |
commit | 5015a300a522c8fb542dc993140e4c360cf4cf5f (patch) | |
tree | dbad49fce32d12ce9c68a81656963cb1803992a0 /lib/Kconfig.debug | |
parent | 8e060c21ae2c265a2b596e9e7f9f97ec274151a4 (diff) |
lib: introduce test_meminit module
Add tests for heap and pagealloc initialization. These can be used to
check init_on_alloc and init_on_free implementations as well as other
approaches to initialization.
Expected test output in the case the kernel provides heap initialization
(e.g. when running with either init_on_alloc=1 or init_on_free=1):
test_meminit: all 10 tests in test_pages passed
test_meminit: all 40 tests in test_kvmalloc passed
test_meminit: all 60 tests in test_kmemcache passed
test_meminit: all 10 tests in test_rcu_persistent passed
test_meminit: all 120 tests passed!
Link: http://lkml.kernel.org/r/20190529123812.43089-4-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Sandeep Patil <sspatil@android.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r-- | lib/Kconfig.debug | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 4ac4ca21a30a..c6ee805202bd 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -2076,6 +2076,14 @@ config TEST_STACKINIT | |||
2076 | 2076 | ||
2077 | If unsure, say N. | 2077 | If unsure, say N. |
2078 | 2078 | ||
2079 | config TEST_MEMINIT | ||
2080 | tristate "Test heap/page initialization" | ||
2081 | help | ||
2082 | Test if the kernel is zero-initializing heap and page allocations. | ||
2083 | This can be useful to test init_on_alloc and init_on_free features. | ||
2084 | |||
2085 | If unsure, say N. | ||
2086 | |||
2079 | endif # RUNTIME_TESTING_MENU | 2087 | endif # RUNTIME_TESTING_MENU |
2080 | 2088 | ||
2081 | config MEMTEST | 2089 | config MEMTEST |