]> code.ossystems Code Review - openembedded-core.git/commitdiff
security_flags: use -fstack-protector-strong
authorKhem Raj <raj.khem@gmail.com>
Fri, 5 Feb 2016 16:52:41 +0000 (16:52 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 7 Feb 2016 17:29:44 +0000 (17:29 +0000)
This is a better version of -fstack-protector-all with reduced stack usage and
better performance yet giving same amount of coverage.  It's available in gcc
4.9 onwards.

https://outflux.net/blog/archives/2014/01/27/fstack-protector-strong/ has more
details.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/conf/distro/include/security_flags.inc

index 72d31ba67bb1d6c4e2df68b61a8c664c0c4fefe1..5e0ef634bf7b952e009e082d573c6bc1b98f2021 100644 (file)
@@ -9,14 +9,14 @@
 # -O0 which then results in a compiler warning.
 lcl_maybe_fortify = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}"
 
-SECURITY_CFLAGS ?= "-fstack-protector-all -pie -fpie ${lcl_maybe_fortify}"
-SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-all ${lcl_maybe_fortify}"
+SECURITY_CFLAGS ?= "-fstack-protector-strong -pie -fpie ${lcl_maybe_fortify}"
+SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify}"
 
-SECURITY_LDFLAGS ?= "-Wl,-z,relro,-z,now"
-SECURITY_X_LDFLAGS ?= "-Wl,-z,relro"
+SECURITY_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro,-z,now"
+SECURITY_X_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro"
 
 # powerpc does not get on with pie for reasons not looked into as yet
-SECURITY_CFLAGS_powerpc = "-fstack-protector-all ${lcl_maybe_fortify}"
+SECURITY_CFLAGS_powerpc = "-fstack-protector-strong ${lcl_maybe_fortify}"
 # Deal with ppc specific linker failures when using the cflags
 SECURITY_CFLAGS_pn-dbus_powerpc = ""
 SECURITY_CFLAGS_pn-dbus-ptest_powerpc = ""