Hardening Flags Updates for Fedora 28
This system-wide change covers changes to the hardening flags in Fedora 28.
- Compile all binaries with stack clash protection (
-fstack-clash-protection). As a result, attempts to jump the stack guard (a requirement for stack clash attacks) will reliably result in a crash rather than giving the attacker control over stack/heap objects.
- Enable C++ standard library hardening with
-D_GLIBCXX_ASSERTIONS. This turns on cheap range checks for C++ arrays, vectors, and strings.
- Enable control flow protection on x86-64 using
.got.pltisolation in binutils, to support a read-only GOT with lazy binding on systems which provide support for memory protection keys.
- Use --enable-default-pie to ensure PIE support is enabled across all architectures.
Benefit to Fedora
Fedora will benefit from additional security hardening provided by the GNU toolchain.
- Proposal owners: Propose changes to
redhat-rpm-configto implement the new flags.
- Other developers: The
redhat-rpm-configchanges need to be merged. For packages which bypass the RPM compiler flags injection mechanism, developers need to manually implement the new flags.
- Release engineering: #7220 and #7249 (a check of an impact with Release Engineering is needed)
- Policies and guidelines: N/A (not needed for this Change; covered by the existing Packaging Guidelines)
- Trademark approval: N/A (not needed for this Change)
The C++ standard library hardening may detect some invalid out-of-bounds access which have gone unnoticed before.
How To Test
Changes/Annobin will be used to track the implementation of the hardening flags.
There will not be any user-visible differences.
Testing depends on Changes/Annobin.
- Contingency mechanism: Revert change to
redhat-rpm-config, or make them specific to supported architectures only.
- An ABI-compliant
-fstack-clash-protectionimplementation has not yet been demonstrated for 32-bit ARM (armhfp). It may be necessary to disable the hardening there.
- An ABI-compliant
- Contingency deadline: final mass rebuild
- Blocks release? no
- Blocks product? N/A
Fedora 28 has been built with updated hardening flags, as provided by the GNU toolchain. Compared to previous releases, the following changes have been made to the way programs are built:
- Stack clash protection is enabled.
- Lightweight assertions have been switched on in the C++ standard run-time library.
- On x86-64, binaries have been built in a way that they will support Control Flow Enforcement Technology (CET) in the future.
- On systems which support memory protection keys, lazy binding now uses a read-only GOT.
- By default the toolchain generates PIE executables to further harden Fedora executables from attacks.