Skip to content

System hardening: enable basic options

Jan Pavlinec requested to merge hardening into master

This PR enables hardening options for all builds.

  1. It sets FORTIFY_SOURCE = 2 http://man7.org/linux/man-pages/man7/feature_test_macros.7.html

If _FORTIFY_SOURCE is set to 1, with compiler optimization level 1 (gcc -O1) and above, checks that shouldn't change the behavior of conforming programs are performed. With _FORTIFY_SOURCE set to 2, some more checking is added, but some conforming programs might fail.

  1. Enables strong stackguard protection STACKPROTECTOR_STRONG https://lwn.net/Articles/584225/

  2. Enables ASLR for user space application PKG_ASLR_PIE https://en.wikipedia.org/wiki/Address_space_layout_randomization#Linux

Merge request reports