aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-20 13:26:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-20 13:26:31 -0500
commitad3ab302fd8239a1ddee01e606683c3197ca6908 (patch)
treed4984d29bcc90252118bdf3a0c32d5c1e027fc08 /arch/sh
parenta693c46e14c9fdadbcd68ddfa94a4f72495531a9 (diff)
parent8779657d29c0ebcc0c94ede4df2f497baf1b563f (diff)
Merge branch 'core-stackprotector-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull strong stackprotector support from Ingo Molnar: "This tree adds a CONFIG_CC_STACKPROTECTOR_STRONG=y, a new, stronger stack canary checking method supported by the newest GCC versions (4.9 and later). Here's the 'intensity comparison' between the various protection modes: - defconfig 11430641 kernel text size 36110 function bodies - defconfig + CONFIG_CC_STACKPROTECTOR_REGULAR 11468490 kernel text size (+0.33%) 1015 of 36110 functions are stack-protected (2.81%) - defconfig + CONFIG_CC_STACKPROTECTOR_STRONG via this patch 11692790 kernel text size (+2.24%) 7401 of 36110 functions are stack-protected (20.5%) the strong model comes with non-trivial costs, which is why we preserved the 'regular' and 'none' models as well" * 'core-stackprotector-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG stackprotector: Unify the HAVE_CC_STACKPROTECTOR logic between architectures
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