-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Add compiler security hardening flags to CMakeLists.txt for local development builds. While Fedora's RPM build system automatically adds these flags via %cmake macro, explicitly setting them ensures consistent security posture across all build environments.
Current State
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG")Proposed Addition
# Security hardening flags
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -fstack-protector-strong")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro,-z,now")Flags Explained
| Flag | Purpose |
|---|---|
-fstack-protector-strong |
Detects stack buffer overflows |
-D_FORTIFY_SOURCE=2 |
Runtime buffer overflow detection |
-Wl,-z,relro,-z,now |
Full RELRO - protects GOT from overwrites |
Priority
Low - This is a defense-in-depth improvement. RPM builds via rpmbuild or fedpkg already include these flags automatically.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request