<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Just FYI<br>
      <br>
      Regards<br>
    </p>
    <div class="moz-forward-container"><br>
      <br>
      --- Treść przekazanej wiadomości ---
      <table class="moz-email-headers-table" cellspacing="0"
        cellpadding="0" border="0">
        <tbody>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Temat: </th>
            <td>[arch-dev-public] Changing compilation flags</td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Data: </th>
            <td>Mon, 24 Oct 2016 13:56:14 +1000</td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Nadawca:
            </th>
            <td>Allan McRae <a class="moz-txt-link-rfc2396E" href="mailto:allan@archlinux.org"><allan@archlinux.org></a></td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Odpowiedź-Do:
            </th>
            <td>Public mailing list for Arch Linux development
              <a class="moz-txt-link-rfc2396E" href="mailto:arch-dev-public@archlinux.org"><arch-dev-public@archlinux.org></a></td>
          </tr>
          <tr>
            <th valign="BASELINE" nowrap="nowrap" align="RIGHT">Adresat:
            </th>
            <td>Public mailing list for Arch Linux development
              <a class="moz-txt-link-rfc2396E" href="mailto:arch-dev-public@archlinux.org"><arch-dev-public@archlinux.org></a></td>
          </tr>
        </tbody>
      </table>
      <br>
      <br>
      <pre>Hi all,

The results from the test-sec-flags [1] suite are in.  Many thanks to
those that wrote this and those that submitted results.  I'm not going
to list the summaries here, but the results show that at worst enabling
a bunch of security flags in our packages will have a <1% impact on
performance (and more likely a fraction of a percent).

That means we will add all of these to our default CFLAGS/LDFLAGS etc.
The changes are:

1) building gcc to enable PIE by default
2) add -z,now to LDFLAGS
3) and -fno-plt and -fstack-check to our CFLAGS

Adding PIE means that programs get loaded at a random address,
preventing an attacker from manipulating global data or hijacking
control by reusing code.  Without this, ASLR is ineffective.  Enabling
this by default in our compiler (there is a configure flag) means we
will need to rebuild all packages with static libraries (which should be
a fairly limited set).

Adding -z,now to LDFLAGS disables lazy loading.  This means all function
symbols are loaded at startup (with minor performance hit), but that
means our RELRO support will make everything ro instead of some of the
things.  Doing this enables us to use -fno-plt in our CFLAGS, which is a
run-time optimisation allowing faster use of libraries.

Adding -fstack-check to our CFLAGS guarantees stack overflows aren't
exploitable.

Note that any of these flags can be disabled in a PKGBUILD if really
needed...  But if that is the case, bug reports should be filed.


Given an assumed lack of objection, I will enable the build flags in our
pacman.conf and rebuild gcc to enable pie and put them in [staging] at
the end of this week (what better way to celebrate Halloween).  We will
need a new devtools release then too.  Then the packages with static
libraries will need rebuilt.

After that, I would like to see [core] completely rebuilt, and audited
to ensure our CFLAGS/LDFLAGS are actually being used in the build.

Cheers,
Allan


[1] <a class="moz-txt-link-freetext" href="https://www.archlinux.org/news/test-sec-flags-call-for-assistance/">https://www.archlinux.org/news/test-sec-flags-call-for-assistance/</a>
</pre>
    </div>
  </body>
</html>