Open Mikilio opened 1 month ago
Just trying to notify an active contributor to this module @emilazy
Thanks for the ping. Unfortunately while “active contributor” and “contributor this module” are both true, “active contributor to this module” isn’t quite :) The hardened profile isn’t in an ideal state and needs a lot of work. I do think we should have a good hardened profile, and I’d like to work on that, but I perennially have higher‐priority tasks that mean I haven’t touched it in years. Some of the settings it adjusts can actually make security worse; e.g. turning off security.unprivilegedUsernsClone
is inadvisable on a normal desktop system, as it interferes with browser sandboxing. It may be worth considering how much you benefit from the profile.
page_poison=1
has come up as a suboptimal option to be setting in conjunction with the hardened kernel we use before, in https://github.com/NixOS/nixpkgs/issues/90704. Perhaps it would be worth trying to address that in the hopes that it may accidentally fix this issue. Failing that, did this work for you previously and then break? If so, I suspect that it will probably take a git bisect
over Nixpkgs (remember to use --first-parent
) to find out why.
Totally understandable. I just wanted this to be seen by someone with more voice than me. I have actually adjusted this module for use with a laptop and a specified thread model after doing some thorough reading on kernel hardening. Likewise, I'm willing to share it, but I'd need some names to ping when I do, as it otherwise may never be viewed. NixOS members are an awfully busy bunch.
https://github.com/NixOS/nixpkgs/blame/e88358265511d3a73b30dc6e4c15579844b35280/nixos/modules/profiles/hardened.nix#L46
Turning off this above parameter allows me to boot again. I could not exactly identify what exact pieces of my configuration need this to be disabled, but here is my best description of what is happening.
Notice that it does not even enter systemd stage 1.
I can only suspect that maybe lanzaboote is doing some unexpected access to freed memory, but I couldn't test yet if it's actually lanzaboote fault. That is because it is really annoying on my laptop to disable secure boot and re-enable it later. So maybe someone can help me verify here?