summaryrefslogtreecommitdiffstats
path: root/meta/conf/distro/include/security_flags.inc
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-08-29 22:01:40 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-04 11:03:55 +0100
commit03b6f92245a9f534ba33a69727e15d7084893187 (patch)
treec993b56a5d00e30842a08ae48c74aaf55cdbd2ff /meta/conf/distro/include/security_flags.inc
parent30f54f14dd3641f57398671680f2cafba19a5c61 (diff)
downloadpoky-03b6f92245a9f534ba33a69727e15d7084893187.tar.gz
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 = "" ... (From OE-Core rev: 0ed4a6233bdcb25cbdce698504611541420d92d0) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/distro/include/security_flags.inc')
-rw-r--r--meta/conf/distro/include/security_flags.inc16
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'}"
21 21
22SECURITY_NOPIE_CFLAGS ?= "-no-pie -fno-PIE" 22SECURITY_NOPIE_CFLAGS ?= "-no-pie -fno-PIE"
23 23
24SECURITY_CFLAGS ?= "-fstack-protector-strong ${SECURITY_PIE_CFLAGS} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}" 24SECURITY_STACK_PROTECTOR ?= "-fstack-protector-strong"
25SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
26 25
27SECURITY_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro,-z,now" 26SECURITY_CFLAGS ?= "${SECURITY_STACK_PROTECTOR} ${SECURITY_PIE_CFLAGS} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
28SECURITY_X_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro" 27SECURITY_NO_PIE_CFLAGS ?= "${SECURITY_STACK_PROTECTOR} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
28
29SECURITY_LDFLAGS ?= "${SECURITY_STACK_PROTECTOR} -Wl,-z,relro,-z,now"
30SECURITY_X_LDFLAGS ?= "${SECURITY_STACK_PROTECTOR} -Wl,-z,relro"
29 31
30# powerpc does not get on with pie for reasons not looked into as yet 32# powerpc does not get on with pie for reasons not looked into as yet
31GCCPIE_powerpc = "" 33GCCPIE_powerpc = ""
@@ -56,9 +58,9 @@ SECURITY_STRINGFORMAT_pn-gcc = ""
56TARGET_CC_ARCH_append_class-target = " ${SECURITY_CFLAGS}" 58TARGET_CC_ARCH_append_class-target = " ${SECURITY_CFLAGS}"
57TARGET_LDFLAGS_append_class-target = " ${SECURITY_LDFLAGS}" 59TARGET_LDFLAGS_append_class-target = " ${SECURITY_LDFLAGS}"
58 60
59SECURITY_LDFLAGS_remove_pn-gcc-runtime = "-fstack-protector-strong" 61SECURITY_STACK_PROTECTOR_pn-gcc-runtime = ""
60SECURITY_LDFLAGS_remove_pn-glibc = "-fstack-protector-strong" 62SECURITY_STACK_PROTECTOR_pn-glibc = ""
61SECURITY_LDFLAGS_remove_pn-glibc-initial = "-fstack-protector-strong" 63SECURITY_STACK_PROTECTOR_pn-glibc-initial = ""
62# All xorg module drivers need to be linked this way as well and are 64# All xorg module drivers need to be linked this way as well and are
63# handled in recipes-graphics/xorg-driver/xorg-driver-common.inc 65# handled in recipes-graphics/xorg-driver/xorg-driver-common.inc
64SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}" 66SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}"