diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-08-29 22:01:40 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-30 16:16:06 +0100 |
commit | 0ed4a6233bdcb25cbdce698504611541420d92d0 (patch) | |
tree | 732ec6f9ffab546ccf6ca3275bab662e1d4ba44c | |
parent | 38c410bb7d1688cd952da9f19269c2a65a92ab45 (diff) | |
download | openembedded-core-0ed4a6233bdcb25cbdce698504611541420d92d0.tar.gz openembedded-core-0ed4a6233bdcb25cbdce698504611541420d92d0.tar.bz2 openembedded-core-0ed4a6233bdcb25cbdce698504611541420d92d0.zip |
security_flags.inc: add var-SECURITY_STACK_PROTECTOR to improve variable OVERRIDES
There are var-SECURITY_PIE_CFLAGS, var-lcl_maybe_fortify and
var-SECURITY_STRINGFORMAT which are helpful for OVERRIDES.
Also add var-SECURITY_STACK_PROTECTOR, and drop hardcoded `_remove'
overrides. Such as `4ca946c security_flags: use -fstack-protector-strong',
it s/-fstack-protector-all/-fstack-protector-strong/, only tweak
var-SECURITY_STACK_PROTECTOR is sufficient.
The fix does not have any side affect on SECURITY_CFLAGS of glibc/
glibc-initial/gcc-runtime, these three directly assigned with "".
...
SECURITY_CFLAGS_pn-glibc = ""
SECURITY_CFLAGS_pn-glibc-initial = ""
SECURITY_CFLAGS_pn-gcc-runtime = ""
...
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/conf/distro/include/security_flags.inc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc index e113f999a1..620978a8ed 100644 --- a/meta/conf/distro/include/security_flags.inc +++ b/meta/conf/distro/include/security_flags.inc @@ -21,11 +21,13 @@ SECURITY_PIE_CFLAGS ?= "${@'' if '${GCCPIE}' else '-pie -fPIE'}" SECURITY_NOPIE_CFLAGS ?= "-no-pie -fno-PIE" -SECURITY_CFLAGS ?= "-fstack-protector-strong ${SECURITY_PIE_CFLAGS} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" -SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" +SECURITY_STACK_PROTECTOR ?= "-fstack-protector-strong" -SECURITY_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro,-z,now" -SECURITY_X_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro" +SECURITY_CFLAGS ?= "${SECURITY_STACK_PROTECTOR} ${SECURITY_PIE_CFLAGS} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" +SECURITY_NO_PIE_CFLAGS ?= "${SECURITY_STACK_PROTECTOR} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" + +SECURITY_LDFLAGS ?= "${SECURITY_STACK_PROTECTOR} -Wl,-z,relro,-z,now" +SECURITY_X_LDFLAGS ?= "${SECURITY_STACK_PROTECTOR} -Wl,-z,relro" # powerpc does not get on with pie for reasons not looked into as yet GCCPIE_powerpc = "" @@ -56,9 +58,9 @@ SECURITY_STRINGFORMAT_pn-gcc = "" TARGET_CC_ARCH_append_class-target = " ${SECURITY_CFLAGS}" TARGET_LDFLAGS_append_class-target = " ${SECURITY_LDFLAGS}" -SECURITY_LDFLAGS_remove_pn-gcc-runtime = "-fstack-protector-strong" -SECURITY_LDFLAGS_remove_pn-glibc = "-fstack-protector-strong" -SECURITY_LDFLAGS_remove_pn-glibc-initial = "-fstack-protector-strong" +SECURITY_STACK_PROTECTOR_pn-gcc-runtime = "" +SECURITY_STACK_PROTECTOR_pn-glibc = "" +SECURITY_STACK_PROTECTOR_pn-glibc-initial = "" # All xorg module drivers need to be linked this way as well and are # handled in recipes-graphics/xorg-driver/xorg-driver-common.inc SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}" |