-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos: allow customizing the kernel RANDSTRUCT seed #53826
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
Conversation
Nit: Exposing such a specialized feature in the general interface may seem a little ad-hoc. |
@@ -67,6 +68,19 @@ in | |||
description = "A list of additional patches to apply to the kernel."; | |||
}; | |||
|
|||
boot.kernel.randstructSeed = mkOption { | |||
type = types.str; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be neat to be able to read the seed from a file instead (e.g., if I want to share my config but not the seed)
If you don't want to create a new module, there's |
0fd0d3a
to
8769d2d
Compare
@GrahamcOfBorg build linux_latest_hardened linux linux_latest |
@GrahamcOfBorg test hardened |
Motivation for this change
See #53592. RANDSTRUCT is designed to make kernel exploitation harder through diversification of the builds. Allowing users to set their own RANDSTRUCT seed differentiates their kernel build from the rest of the NixOS hardened users. In a multi-host deployment this can also be used to deploy differently seeded builds on each machine.
I was torn on whether to put this in boot/kernel.nix or create a new module in security/ for the option -- in the end I decided on boot/kernel.nix because it makes the implementation much simpler, but I'm definitely open to the "new module" option too if someone has a strong opinion about this.
Still a NixOS noob, not sure if this is the right way to do things. Let me know!
@joachifm @NeQuissimus fyi
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)