Skip to content

Commit 2bb9954

Browse files
committed
Merge tag 'gcc-plugins-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull gcc-plugins updates from Kees Cook: "This adds additional type coverage to the existing structleak plugin and adds a large set of selftests to help evaluate stack variable zero-initialization coverage. That can be used to test whatever instrumentation might be performing zero-initialization: either with the structleak plugin or with Clang's coming "-ftrivial-auto-var-init=zero" option. Summary: - Add scalar and array initialization coverage - Refactor Kconfig to make options more clear - Add self-test module for testing automatic initialization" * tag 'gcc-plugins-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: lib: Introduce test_stackinit module gcc-plugins: structleak: Generalize to all variable types
2 parents a39f009 + 50ceaa9 commit 2bb9954

6 files changed

Lines changed: 463 additions & 22 deletions

File tree

‎lib/Kconfig.debug‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,16 @@ config TEST_OBJAGG
20162016
(or module load).
20172017

20182018

2019+
config TEST_STACKINIT
2020+
tristate "Test level of stack variable initialization"
2021+
help
2022+
Test if the kernel is zero-initializing stack variables and
2023+
padding. Coverage is controlled by compiler flags,
2024+
CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF,
2025+
or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL.
2026+
2027+
If unsure, say N.
2028+
20192029
endif # RUNTIME_TESTING_MENU
20202030

20212031
config MEMTEST

‎lib/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ obj-$(CONFIG_TEST_KMOD) += test_kmod.o
7777
obj-$(CONFIG_TEST_DEBUG_VIRTUAL) += test_debug_virtual.o
7878
obj-$(CONFIG_TEST_MEMCAT_P) += test_memcat_p.o
7979
obj-$(CONFIG_TEST_OBJAGG) += test_objagg.o
80+
obj-$(CONFIG_TEST_STACKINIT) += test_stackinit.o
8081

8182
obj-$(CONFIG_TEST_LIVEPATCH) += livepatch/
8283

0 commit comments

Comments
 (0)