diff options
author | Jim Barlow <jim@purplerock.ca> | 2014-12-23 05:24:24 -0800 |
---|---|---|
committer | Jim Barlow <jim@purplerock.ca> | 2014-12-23 05:24:24 -0800 |
commit | a6c072343a8d0beb232b3dc71cf0f5db81fa6629 (patch) | |
tree | 2356dc497f100b2e82dbc2846079a8b9f72ecfa7 /README | |
parent | 164f684eb8e4ebe31d0f9d0603dc25533fa43c5b (diff) | |
download | portable-a6c072343a8d0beb232b3dc71cf0f5db81fa6629.tar.gz portable-a6c072343a8d0beb232b3dc71cf0f5db81fa6629.tar.bz2 portable-a6c072343a8d0beb232b3dc71cf0f5db81fa6629.zip |
configure.ac: use executable hardening where available
Where available, enable stack smashing protection, fortify source,
no-strict-overflow, and read only relocations.
Many Linux distributions automatically enable most of these options.
They are no brainers. The difference introduced here is in asking for a
few more aggressive options. An option to disable the more aggressive
options is provided (--disable-hardening). When set, configure will fall
back to the default CFLAGS on the system - in many cases that will still
be hardened. There is no point in going further than that.
Options enabled are:
-fstack-protector-strong is a relatively new GCC-4.9 feature that is
supposed to give a better balance between performance and protection.
-all is considered too aggressive, but was used in Chromium and other
security critical systems until -strong became available. Follow their
lead and use -strong when possible. clang 6.0 supports -all but not
-strong.
_FORTIFY_SOURCE replaces certain unsafe C str* and mem* functions with
more robust equivalents when the compiler can determine the length of
the buffers involved.
-fno-strict-overflow instructs GCC to not make optimizations based on
the assumption that signed arithmetic will wrap around on overflow (e.g.
(short)0x7FFF + 1 == 0). This prevents the optimizer from doing some
unexpected things. Further improvements should trap signed overflows and
reduce the use of signed to refer to naturally unsigned quantities.
I did not set -fPIE (position independent executables). The critical
function of Open/LibreSSL is as a library, not an executable.
Tested on Ubuntu Linux 14.04.1 LTS, OS X 10.10.1 with "make check".
Signed-off-by: Jim Barlow <jim@purplerock.ca>
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions