Add security hardening flags for variable initialization and code separation - #12
Open
assisted-by-ai wants to merge 1 commit into
Open
Conversation
Add three additional compile-time security options: - -ftrivial-auto-var-init=zero: zero-initializes local variables to prevent information leaks from uninitialized stack memory - -fzero-call-used-regs=used-gpr: zeros registers before function return to mitigate ROP gadgets and register-based info leaks - -Wl,-z,separate-code: separates code pages from data pages in the ELF binary, ensuring code pages are truly non-writable https://claude.ai/code/session_0142B2pFVbeUUMQtjProiL6q
Contributor
|
Accepted with tweaks in ArrayBolt3@377dbac. |
adrelanos
pushed a commit
that referenced
this pull request
May 10, 2026
Re-applies session work lost during rebase: explicit ANTHROPIC_API_KEY secret in .github/workflows/claude-code.yml (replacing secrets: inherit), explicit COVERITY_SCAN_TOKEN/COVERITY_SCAN_EMAIL secrets in .github/workflows/coverity.yml, and corrects the coverity project-name from Whonix-kloak to Whonix/kloak (the URL renders / as -, but the API form parameter requires the slash). Co-authored-by: claude-code <claude-code@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change enhances the security posture of the build by adding three additional compiler and linker hardening flags to prevent information leaks and mitigate code reuse attacks.
Key Changes
-ftrivial-auto-var-init=zero: Zero-initializes all local variables to prevent information leaks from uninitialized stack memory-fzero-call-used-regs=used-gpr: Zeros out general-purpose registers before function returns to mitigate ROP (Return-Oriented Programming) attacks and prevent register-based information leaks-Wl,-z,separate-code: Separates code from data pages in the ELF binary, improving exploit mitigation by preventing code execution from data sectionsImplementation Details
FORTIFY_CFLAGSvariable for compiler-level hardeningLDFLAGSfor binary-level hardeningLDFLAGSdefinition for improved readability while maintaining the same functionalityhttps://claude.ai/code/session_0142B2pFVbeUUMQtjProiL6q