Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc-wrapper: add support for spectrev2 hardening flag #299608

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

risicle
Copy link
Contributor

@risicle risicle commented Mar 27, 2024

Description of changes

This enables the "retpoline" protection on supported compilers for hardening against spectre v2 ("Branch Target Injection") attacks.

There are comparatively few packages that are likely to be vulnerable to this kind of attack, and packages like the kernel handle these flags themselves - so this flag is mostly for the paranoid or users of "hardened" systems (what's the difference har har). Though it is a good demonstrator of how to implement platform-specific hardening flags via hardeningUnsupportedFlagsByTargetPlatform.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@risicle risicle added the 6.topic: stdenv Standard environment label Mar 27, 2024
@risicle risicle force-pushed the ris-spectrev2-hardening-flag branch from 0ac6863 to dc5cfd8 Compare March 28, 2024 18:19
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 28, 2024
@risicle risicle force-pushed the ris-spectrev2-hardening-flag branch from dc5cfd8 to c08c914 Compare March 28, 2024 22:51
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux-stdenv This PR causes stdenv to rebuild 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 28, 2024
this enables the "retpoline" protection on supported compilers
@risicle risicle force-pushed the ris-spectrev2-hardening-flag branch from c08c914 to ee03141 Compare April 6, 2024 10:59
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 3, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: stdenv Standard environment 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants