summaryrefslogtreecommitdiff
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
authorGregory Fong <gregory.0xf0@gmail.com>2013-06-12 17:08:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2013-07-01 15:10:48 +0200
commit36ecafc5ad17861e2bc1fb12af4cc97680e25942 (patch)
tree8b1094782049660b366b417119d34a5a519e0c95 /arch/mips/Makefile
parent23df34155b29674465813b327647cd79722aa659 (diff)
MIPS: initial stack protector support
Implements basic stack protector support based on ARM version in c743f38013aeff58ef6252601e397b5ba281c633 , with Kconfig option, constant canary value set at boot time, and script to check if compiler actually supports stack protector. Tested by creating a kernel module that writes past end of char[]. Signed-off-by: Gregory Fong <gregory.0xf0@gmail.com> Cc: linux-mips@linux-mips.org Cc: Filippo Arcidiacono <filippo.arcidiacono@st.com> Cc: Carmelo Amoroso <carmelo.amoroso@st.com> Patchwork: https://patchwork.linux-mips.org/patch/5448/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r--arch/mips/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index dd58a04ef4bc..37f9ef324f2f 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -227,6 +227,10 @@ KBUILD_CPPFLAGS += -DDATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)
LDFLAGS += -m $(ld-emul)
+ifdef CONFIG_CC_STACKPROTECTOR
+ KBUILD_CFLAGS += -fstack-protector
+endif
+
ifdef CONFIG_MIPS
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \