Skip to content

Commit f154066

Browse files
committed
gcc-plugins/stackleak: Provide verbose mode
In order to compare instrumentation between builds, make the verbose mode of the plugin available during the build. This is rarely needed (behind EXPERT) and very noisy (disabled for COMPILE_TEST). Cc: Alexander Popov <alex.popov@linux.com> Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 26291c5 commit f154066

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

scripts/Makefile.gcc-plugins

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
3737
+= -fplugin-arg-stackleak_plugin-track-min-size=$(CONFIG_STACKLEAK_TRACK_MIN_SIZE)
3838
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK) \
3939
+= -fplugin-arg-stackleak_plugin-arch=$(SRCARCH)
40+
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STACKLEAK_VERBOSE) \
41+
+= -fplugin-arg-stackleak_plugin-verbose
4042
ifdef CONFIG_GCC_PLUGIN_STACKLEAK
4143
DISABLE_STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-disable
4244
endif

security/Kconfig.hardening

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ config GCC_PLUGIN_STACKLEAK
174174
* https://grsecurity.net/
175175
* https://pax.grsecurity.net/
176176

177+
config GCC_PLUGIN_STACKLEAK_VERBOSE
178+
bool "Report stack depth analysis instrumentation" if EXPERT
179+
depends on GCC_PLUGIN_STACKLEAK
180+
depends on !COMPILE_TEST # too noisy
181+
help
182+
This option will cause a warning to be printed each time the
183+
stackleak plugin finds a function it thinks needs to be
184+
instrumented. This is useful for comparing coverage between
185+
builds.
186+
177187
config STACKLEAK_TRACK_MIN_SIZE
178188
int "Minimum stack frame size of functions tracked by STACKLEAK"
179189
default 100

0 commit comments

Comments
 (0)