aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-12-19 14:35:58 -0500
committerIngo Molnar <mingo@kernel.org>2013-12-20 03:38:40 -0500
commit19952a92037e752f9d3bbbad552d596f9a56e146 (patch)
tree8a1930b4775cb17865c03faf55eafdd7b97be8ba /arch/sh
parentb0031f227e47919797dc0e1c1990f3ef151ff0cc (diff)
stackprotector: Unify the HAVE_CC_STACKPROTECTOR logic between architectures
Instead of duplicating the CC_STACKPROTECTOR Kconfig and Makefile logic in each architecture, switch to using HAVE_CC_STACKPROTECTOR and keep everything in one place. This retains the x86-specific bug verification scripts. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Michal Marek <mmarek@suse.cz> Cc: Russell King <linux@arm.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: James Hogan <james.hogan@imgtec.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@linux-mips.org Cc: linux-arch@vger.kernel.org Link: http://lkml.kernel.org/r/1387481759-14535-2-git-send-email-keescook@chromium.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/Kconfig15
-rw-r--r--arch/sh/Makefile4
2 files changed, 1 insertions, 18 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9b0979f4df7a..ce298317a73e 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -66,6 +66,7 @@ config SUPERH32
66 select PERF_EVENTS 66 select PERF_EVENTS
67 select ARCH_HIBERNATION_POSSIBLE if MMU 67 select ARCH_HIBERNATION_POSSIBLE if MMU
68 select SPARSE_IRQ 68 select SPARSE_IRQ
69 select HAVE_CC_STACKPROTECTOR
69 70
70config SUPERH64 71config SUPERH64
71 def_bool ARCH = "sh64" 72 def_bool ARCH = "sh64"
@@ -695,20 +696,6 @@ config SECCOMP
695 696
696 If unsure, say N. 697 If unsure, say N.
697 698
698config CC_STACKPROTECTOR
699 bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
700 depends on SUPERH32
701 help
702 This option turns on the -fstack-protector GCC feature. This
703 feature puts, at the beginning of functions, a canary value on
704 the stack just before the return address, and validates
705 the value just before actually returning. Stack based buffer
706 overflows (that need to overwrite this return address) now also
707 overwrite the canary, which gets detected and the attack is then
708 neutralized via a kernel panic.
709
710 This feature requires gcc version 4.2 or above.
711
712config SMP 699config SMP
713 bool "Symmetric multi-processing support" 700 bool "Symmetric multi-processing support"
714 depends on SYS_SUPPORTS_SMP 701 depends on SYS_SUPPORTS_SMP
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index aed701c7b11b..d4d16e4be07c 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -199,10 +199,6 @@ ifeq ($(CONFIG_DWARF_UNWINDER),y)
199 KBUILD_CFLAGS += -fasynchronous-unwind-tables 199 KBUILD_CFLAGS += -fasynchronous-unwind-tables
200endif 200endif
201 201
202ifeq ($(CONFIG_CC_STACKPROTECTOR),y)
203 KBUILD_CFLAGS += -fstack-protector
204endif
205
206libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) 202libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
207libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) 203libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
208 204