Merge tag 'integrity-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar...
[linux-2.6-microblaze.git] / Makefile
index 61741e9..2af6e2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -841,6 +841,11 @@ endif
 # for the randomize_kstack_offset feature. Disable it for all compilers.
 KBUILD_CFLAGS  += $(call cc-option, -fno-stack-clash-protection)
 
+# Clear used registers at func exit (to reduce data lifetime and ROP gadgets).
+ifdef CONFIG_ZERO_CALL_USED_REGS
+KBUILD_CFLAGS  += -fzero-call-used-regs=used-gpr
+endif
+
 DEBUG_CFLAGS   :=
 
 # Workaround for GCC versions < 5.0