<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/conf/distro/include/security_flags.inc, branch uninative-3.5</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=uninative-3.5</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=uninative-3.5'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2021-08-02T14:44:10+00:00</updated>
<entry>
<title>Convert to new override syntax</title>
<updated>2021-08-02T14:44:10+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-07-28T22:28:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=bb6ddc3691ab04162ec5fd69a2d5e7876713fd15'/>
<id>urn:sha1:bb6ddc3691ab04162ec5fd69a2d5e7876713fd15</id>
<content type='text'>
This is the result of automated script conversion:

scripts/contrib/convert-overrides.py &lt;oe-core directory&gt;

converting the metadata to use ":" as the override character instead of "_".

(From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags.inc: Add same O&lt;level&gt; as in SELECTED_OPTIMIZATION</title>
<updated>2021-02-12T23:32:16+00:00</updated>
<author>
<name>Khem Raj</name>
<email>raj.khem@gmail.com</email>
</author>
<published>2021-02-10T07:40:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=fa7db243672ec7d8e1a1f45341ceadb0bc212794'/>
<id>urn:sha1:fa7db243672ec7d8e1a1f45341ceadb0bc212794</id>
<content type='text'>
Adding -O can be troublesome in some packages where it may override the
O&lt;n&gt; specified by CFLAGS, this can be due to configure processing of
CFLAGS and munging them into new values in Makefiles, which is
contructed from CC and CFLAGS passed by bitbake environment. Problem
arises if the sequence is altered, which seems to be the case in some
packages e.g. ncurses, where the value from CC variable is added last
and thus overrides -O&lt;n&gt; coming from CFLAGS,

Therefore grok the value from SELECTED_OPTIMIZATION and append the
appropriate -O&lt;level&gt; flag to lcl_maybe_fortify so the level does not
change inaderdantly.

Since we do not use -O0 anymore there is no point of checking for
DEBUG_BUILD since it uses -Og now which works fine with
-D_FORTIFY_SOURCE=2, so check for optlevel O0 instead

(From OE-Core rev: 9571a18f7d15b3bffafc2e277ab90a21d6763697)

Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
Cc: Anuj Mittal &lt;anuj.mittal@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags.inc: Use -O with -D_FORTIFY_SOURCE</title>
<updated>2021-02-08T14:47:16+00:00</updated>
<author>
<name>Khem Raj</name>
<email>raj.khem@gmail.com</email>
</author>
<published>2021-02-06T06:31:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=525493e3efc9480a671dd0cd848923725961fc12'/>
<id>urn:sha1:525493e3efc9480a671dd0cd848923725961fc12</id>
<content type='text'>
compiler can only use fortify options when some level of optimization is
on, otherwise it ends up sending some warnings.

warning: _FORTIFY_SOURCE requires compiling with optimization (-O) [-W#warnings]

this is usually OK, since -O&lt;level&gt; would be added via CFLAGS to
compiler cmdline in normal compile stages, however during configure
there are problems when CC,CPP,CXX are probed alone in configure tests
which results in above warning, which confuses the configure results and
autotools 2.70+ detects it as error e.g.

configure:17292: error: C preprocessor "riscv32-yoe-linux-clang -target riscv32-yoe-linux      -mlittle-endian -mno-relax -Qunused-arguments -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/b/yoe/master/build/tmp/work/riscv32-yoe-linux/ndpi/3.4-r0/recipe-sysroot -E" fails sanity check
See `config.log' for more details

therefore adding a -O ( which actually is -O1 ) to lcl_maybe_fortify
means we can properly test these configure tests and real -O&lt;level&gt; will
still override -O added here, so overrall behavior improves

(From OE-Core rev: b6113dd68caa46d56cf3c8293119f2b9d8b137fd)

Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>grub: Remove native version of grub-efi</title>
<updated>2020-06-23T11:31:03+00:00</updated>
<author>
<name>Jacob Kroon</name>
<email>jacob.kroon@gmail.com</email>
</author>
<published>2020-06-22T11:43:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2d740a8c710a001d7de48881fb3ec227f4e25c92'/>
<id>urn:sha1:2d740a8c710a001d7de48881fb3ec227f4e25c92</id>
<content type='text'>
The native version of grub-efi only installs the tools

  /usr/bin/grub-editenv
  /usr/bin/grub-mkimage

to sysroots-components/, but equivalent tools are already provided by
grub-native, the difference on x86_64 being 4 hardwired paths in grub-mkimage
(values taken from grub-native):

  LOCALEDIR       = $TMPDIR/work/x86_64-linux/grub-native/2.04-r0/recipe-sysroot-native/usr/share/locale
  GRUB_DATADIR    = $TMPDIR/work/x86_64-linux/grub-native/2.04-r0/recipe-sysroot-native/usr/share
  GRUB_LIBDIR     = $TMPDIR/work/x86_64-linux/grub-native/2.04-r0/recipe-sysroot-native/usr/lib
  GRUB_SYSCONFDIR = $TMPDIR/work/x86_64-linux/grub-native/2.04-r0/recipe-sysroot-native/etc

If grub-native and grub-efi-native are built with the following patch

 --- grub-2.04.orig/configure.ac
 +++ grub-2.04/configure.ac
 @@ -1980,10 +1980,10 @@ grub_libdir="$(eval echo "$libdir")"
  grub_localedir="$(eval echo "$localedir")"
  grub_datadir="$(eval echo "$datadir")"
  grub_sysconfdir="$(eval echo "$sysconfdir")"
 -AC_DEFINE_UNQUOTED(LOCALEDIR, "$grub_localedir", [Locale dir])
 -AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "$grub_libdir", [Library dir])
 -AC_DEFINE_UNQUOTED(GRUB_DATADIR, "$grub_datadir", [Data dir])
 -AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "$grub_sysconfdir", [Configuration dir])
 +AC_DEFINE_UNQUOTED(LOCALEDIR, "/non-existent", [Locale dir])
 +AC_DEFINE_UNQUOTED(GRUB_LIBDIR, "/non-existent", [Library dir])
 +AC_DEFINE_UNQUOTED(GRUB_DATADIR, "/non-existent", [Data dir])
 +AC_DEFINE_UNQUOTED(GRUB_SYSCONFDIR, "/non-existent", [Configuration dir])

the produced grub-editenv/grub-mkimage binaries become binary equivalent,
assuming reproducible builds is active. Since the unpatched values of
LOCALEDIR/GRUB_DATADIR/GRUB_LIBDIR/GRUB_SYSCONFDIR point to directories that
are not expected to exist at runtime, they can be ignored.

Therefore:
 * remove grub-efi-native and instead rely on the same tools from
   grub-native
 * replace references to grub-efi-native with grub-native
 * remove unused grub-efi-native security flags overrides

(From OE-Core rev: 7044181df7487f047d175242f7ebbc3c35bf5402)

Signed-off-by: Jacob Kroon &lt;jacob.kroon@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags: Remove stack protector flag from LDFLAGS</title>
<updated>2020-06-04T12:27:32+00:00</updated>
<author>
<name>Junling Zheng</name>
<email>zhengjunling@huawei.com</email>
</author>
<published>2020-06-03T14:08:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=171a8360f5e5d89a3396bb7295fc19ce9d4eff20'/>
<id>urn:sha1:171a8360f5e5d89a3396bb7295fc19ce9d4eff20</id>
<content type='text'>
SECURITY_LDFLAGS contains stack protector flag inappropriately, which
has already be contained in SECURITY_CFLAGS. Let's remove it from
SECURITY_LDFLAGS.

(From OE-Core rev: 549cce578b859986e37900bf15c1bf904d33e47b)

Signed-off-by: Junling Zheng &lt;zhengjunling@huawei.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags.inc: fix flags missing from SDK toolchain</title>
<updated>2020-03-25T10:02:49+00:00</updated>
<author>
<name>Tom Hochstein</name>
<email>tom.hochstein@nxp.com</email>
</author>
<published>2020-03-24T17:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=f17f89e2f4ad0ef56fc2ed5efaf99b52e01c9c47'/>
<id>urn:sha1:f17f89e2f4ad0ef56fc2ed5efaf99b52e01c9c47</id>
<content type='text'>
The security flags were missing from the SDK toolchain
because they were added specifically to class-target.
Add them to class-cross-canadian as well (since the SDK environment
file is created from cross-canadian target flags).

(From OE-Core rev: cd46e8f890069a40d1e9048cfa0f378dec1dc5e9)

Signed-off-by: Tom Hochstein &lt;tom.hochstein@nxp.com&gt;
Signed-off-by: Antoine Manache &lt;a.manache@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags.inc: Add overrides for glibc-testsuite to match glibc</title>
<updated>2019-09-06T11:45:47+00:00</updated>
<author>
<name>Nathan Rossi</name>
<email>nathan@nathanrossi.com</email>
</author>
<published>2019-09-05T13:44:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e5fe46c4c09b4a73da0983328700311a63736a5e'/>
<id>urn:sha1:e5fe46c4c09b4a73da0983328700311a63736a5e</id>
<content type='text'>
Ensure glibc-testsuite has the same flags as glibc.

(From OE-Core rev: f8ab08441f90eb75295304c57746c6e5f907ca64)

Signed-off-by: Nathan Rossi &lt;nathan@nathanrossi.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Clean up remnants of glibc-initial</title>
<updated>2019-09-06T07:15:45+00:00</updated>
<author>
<name>Nathan Rossi</name>
<email>nathan@nathanrossi.com</email>
</author>
<published>2019-09-05T13:44:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=1c115da44666f8ab1e39cd0b20111464b08ed945'/>
<id>urn:sha1:1c115da44666f8ab1e39cd0b20111464b08ed945</id>
<content type='text'>
Remove remnants of the glibc-initial recipe.

(From OE-Core rev: 332b1e21db3e0cbeeb14f12dd6aeedb89b76d761)

Signed-off-by: Nathan Rossi &lt;nathan@nathanrossi.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags.inc: add var-SECURITY_STACK_PROTECTOR to improve variable OVERRIDES</title>
<updated>2018-09-04T10:03:55+00:00</updated>
<author>
<name>Hongxu Jia</name>
<email>hongxu.jia@windriver.com</email>
</author>
<published>2018-08-29T14:01:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=03b6f92245a9f534ba33a69727e15d7084893187'/>
<id>urn:sha1:03b6f92245a9f534ba33a69727e15d7084893187</id>
<content type='text'>
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 &lt;hongxu.jia@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>security_flags.inc: use `?=' to set a default var-lcl_maybe_fortify</title>
<updated>2018-09-04T10:03:55+00:00</updated>
<author>
<name>Hongxu Jia</name>
<email>hongxu.jia@windriver.com</email>
</author>
<published>2018-08-29T09:04:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=30f54f14dd3641f57398671680f2cafba19a5c61'/>
<id>urn:sha1:30f54f14dd3641f57398671680f2cafba19a5c61</id>
<content type='text'>
- Since poky enable security flags+pie by default, tweak comments
to sync with it.
[poky commit]
491082c poky.conf: Enable security flags+pie by default
29d76b3 poky-lsb: Remove including security_flags.inc
[poky commit]

- Use `?=' to set a default lcl_maybe_fortify, it is helpful for
variable OVERRIDES.

(From OE-Core rev: 38c410bb7d1688cd952da9f19269c2a65a92ab45)

Signed-off-by: Hongxu Jia &lt;hongxu.jia@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
