-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
luksroot: Use keyctl over ramfs #273591
Comments
How does this relate to systemd-ask-password and friends, which we use at least in the systemd-in-initrd case? |
I think the ramfs stuff will disappear as soon as we deprecate the scripted stage 1. So I don't know if this is a good idea to spend time on that. |
|
@RaitoBezarius Thanks for pointing that out! What will replace the current scripted stage 1, does this mean systemd-in-initrd with systemd-ask-password? I am curious how the many cases such as yubikey and gpg can be realized without scripting. Is there something I can already switch to or help with instead of patching scripted stage 1? |
@stackcoder It's likely we'll have to deprecate the old yubikey and gpg things along with scripted stage 1. They're very obscure in terms of implementation anyway. systemd-initrd makes it very easy to use FIDO2 though, so I hope we have most users covered that way. Anyway, yes, systemd-initrd does already use the kernel keyring for exactly this purpose. |
I'd like to see this PR just for this option really. It would be nice to cache my luks password to unlock my gnome-keyring with auto/biometric login like debian/fedora do. |
I've tried to switch to systemd using the First Sorry but scripted stage 1 is (at least at this time) much more reliable to bring up the system. |
@stackcoder None of that has anything to do with this issue. But I'll reply briefly and direct you to better places to go for support.
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/unlocking-multiple-luks-devices-with-same-passphrase/45856/13 |
When the option reusePassphrases is activated nixos stores the plaintext passphrase on a ramdisk located at
/crypt-ramfs/passphrase
. The wohle ramdisk is destoryed using umount later by postCommands. While umount just frees the memory the password might still resists somewhere.Even if a ramdisk is used here, the Kernel Key Retention Service resp. keyctl is better suited for this purpose. That's how Debian implemented their luks passphrase caching, within mostly two scripts: decrypt_keyctl and cryptdisks-functions.
Compared to the current solution kernel keyring offers advantages:
What do you think of using keyctl over ramfs for reusePassphrases, should we replace it or add an option? If I would make a PR for this, is there a chance to get it upstream?
The text was updated successfully, but these errors were encountered: