aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--arch/Kconfig8
-rw-r--r--arch/x86/Kconfig2
3 files changed, 6 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 20b1aa928d78..f0f934097f64 100644
--- a/Makefile
+++ b/Makefile
@@ -693,7 +693,7 @@ else
693endif 693endif
694endif 694endif
695# Find arch-specific stack protector compiler sanity-checking script. 695# Find arch-specific stack protector compiler sanity-checking script.
696ifdef CONFIG_CC_STACKPROTECTOR 696ifdef stackp-name
697 stackp-path := $(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh 697 stackp-path := $(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh
698 stackp-check := $(wildcard $(stackp-path)) 698 stackp-check := $(wildcard $(stackp-path))
699 # If the wildcard test matches a test script, run it to check functionality. 699 # If the wildcard test matches a test script, run it to check functionality.
@@ -702,6 +702,10 @@ ifdef CONFIG_CC_STACKPROTECTOR
702 stackp-broken := y 702 stackp-broken := y
703 endif 703 endif
704 endif 704 endif
705 ifndef stackp-broken
706 # If the stack protector is functional, enable code that depends on it.
707 KBUILD_CPPFLAGS += -DCONFIG_CC_STACKPROTECTOR
708 endif
705endif 709endif
706KBUILD_CFLAGS += $(stackp-flag) 710KBUILD_CFLAGS += $(stackp-flag)
707 711
diff --git a/arch/Kconfig b/arch/Kconfig
index 467dfa35bf96..9330a9d79dc3 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -538,12 +538,6 @@ config HAVE_CC_STACKPROTECTOR
538 - its compiler supports the -fstack-protector option 538 - its compiler supports the -fstack-protector option
539 - it has implemented a stack canary (e.g. __stack_chk_guard) 539 - it has implemented a stack canary (e.g. __stack_chk_guard)
540 540
541config CC_STACKPROTECTOR
542 def_bool n
543 help
544 Set when a stack-protector mode is enabled, so that the build
545 can enable kernel-side support for the GCC feature.
546
547choice 541choice
548 prompt "Stack Protector buffer overflow detection" 542 prompt "Stack Protector buffer overflow detection"
549 depends on HAVE_CC_STACKPROTECTOR 543 depends on HAVE_CC_STACKPROTECTOR
@@ -564,7 +558,6 @@ config CC_STACKPROTECTOR_NONE
564 558
565config CC_STACKPROTECTOR_REGULAR 559config CC_STACKPROTECTOR_REGULAR
566 bool "Regular" 560 bool "Regular"
567 select CC_STACKPROTECTOR
568 help 561 help
569 Functions will have the stack-protector canary logic added if they 562 Functions will have the stack-protector canary logic added if they
570 have an 8-byte or larger character array on the stack. 563 have an 8-byte or larger character array on the stack.
@@ -578,7 +571,6 @@ config CC_STACKPROTECTOR_REGULAR
578 571
579config CC_STACKPROTECTOR_STRONG 572config CC_STACKPROTECTOR_STRONG
580 bool "Strong" 573 bool "Strong"
581 select CC_STACKPROTECTOR
582 help 574 help
583 Functions will have the stack-protector canary logic added in any 575 Functions will have the stack-protector canary logic added in any
584 of the following conditions: 576 of the following conditions:
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index b0771ceabb4b..d9878f1f3bac 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -322,7 +322,7 @@ config X86_64_SMP
322 322
323config X86_32_LAZY_GS 323config X86_32_LAZY_GS
324 def_bool y 324 def_bool y
325 depends on X86_32 && !CC_STACKPROTECTOR 325 depends on X86_32 && CC_STACKPROTECTOR_NONE
326 326
327config ARCH_SUPPORTS_UPROBES 327config ARCH_SUPPORTS_UPROBES
328 def_bool y 328 def_bool y