Open LunNova opened 1 year ago
FWIW, I've attempted to combine all PIE-related patches into a single branch, which can be found here: https://github.com/NixOS/nixpkgs/compare/master...chivay:nixpkgs:pie-hardening-work
The only problem I've encountered is with Golang - when compiled with PIE against glibc, binaries end up linked with ld.so from at a standard path i..e "/lib" instead of "/nix/store", thus they're unusable.
Apart from that, I'm happy to report that everything seems to work without any issues (at least in my configuration).
TODO
NIX_HARDENING_ENABLE
with the default flags, to avoid inconsistent defaults in different build-support scripts - #206490-static-pie
insteadof-static -pie
forpkgsStatic
Description
fpie should result in almost no performance decrease on x64 and makes some attacks harder, although it is possible to bypass.
We should enable it by default if this is feasible without breaking package builds.
Raising this issue to track this as there was no tracking issue and the last PR attempting this stalled #104091.
Inlining motivation from @TredwellGit's PR:
https://blog.fpmurphy.com/2008/06/position-independent-executables.html
https://fedoraproject.org/wiki/Security_Features_Matrix#Address_Space_Layout_Randomization_.28ASLR.29
https://fedoraproject.org/wiki/Changes/Harden_All_Packages#Detailed_Harden_Flags_Description