]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
security_flags: pass ssp-buffer-size param to stack protector
authorJoshua Lock <joshua.g.lock@intel.com>
Thu, 11 Aug 2016 14:58:41 +0000 (15:58 +0100)
committerJoshua Lock <joshua.g.lock@intel.com>
Fri, 19 Aug 2016 15:24:32 +0000 (16:24 +0100)
This tells the compiler to use a canary to protect any function which
declares a character array of 4 or more bytes on its stack, rather
than the default of 8 or more bytes.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
meta/conf/distro/include/security_flags.inc

index 77fade6d03ddcdee9c7863c6b1c52615eaa78e5c..691cea115682e980ea1746c9ccc6992c05715ee3 100644 (file)
@@ -12,8 +12,8 @@ lcl_maybe_fortify = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE
 # Error on use of format strings that represent possible security problems
 SECURITY_STRINGFORMAT ?= "-Wformat -Wformat-security -Werror=format-security"
 
-SECURITY_CFLAGS ?= "-fstack-protector-strong -pie -fpie ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
-SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
+SECURITY_CFLAGS ?= "-fstack-protector-strong --param ssp-buffer-size=4 -pie -fpie ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
+SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong --param ssp-buffer-size=4 ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
 
 SECURITY_LDFLAGS ?= "-Wl,-z,relro,-z,now"
 SECURITY_X_LDFLAGS ?= "-Wl,-z,relro"