summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 22:44:49 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 22:44:49 +0300
commit2d60d96b6f00de90ec2bc60eb4cdcc46e1e1f161 (patch)
tree32f01785f971d37bfe5521d0af978462a0a33dfb /Makefile
parenteac7078a0fff1e72cf2b641721e3f55ec7e5e21e (diff)
parent709a972efb01efaeb97cad1adc87fe400119c8ab (diff)
downloadlinux-2d60d96b6f00de90ec2bc60eb4cdcc46e1e1f161.tar.xz
Merge tag 'meminit-v5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull compiler-based variable initialization updates from Kees Cook: "This is effectively part of my gcc-plugins tree, but as this adds some Clang support, it felt weird to still call it "gcc-plugins". :) This consolidates Kconfig for the existing stack variable initialization (via structleak and stackleak gcc plugins) and adds Alexander Potapenko's support for Clang's new similar functionality. Summary: - Consolidate memory initialization Kconfigs (Kees) - Implement support for Clang's stack variable auto-init (Alexander)" * tag 'meminit-v5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: security: Implement Clang's stack initialization security: Move stackleak config to Kconfig.hardening security: Create "kernel hardening" config area
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f4b0ae1b5c6a..cd8b71bfba76 100644
--- a/Makefile
+++ b/Makefile
@@ -748,6 +748,11 @@ KBUILD_CFLAGS += -fomit-frame-pointer
endif
endif
+# Initialize all stack variables with a pattern, if desired.
+ifdef CONFIG_INIT_STACK_ALL
+KBUILD_CFLAGS += -ftrivial-auto-var-init=pattern
+endif
+
DEBUG_CFLAGS := $(call cc-option, -fno-var-tracking-assignments)
ifdef CONFIG_DEBUG_INFO