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

nixos/…/swap.nix: don't create a LUKS header for randomEncryption #27188

Merged
merged 1 commit into from
Jul 26, 2017

Conversation

edef1c
Copy link
Member

@edef1c edef1c commented Jul 6, 2017

Creating and then erasing the key relies on the disk erasing data
correctly, and otherwise allows attackers to simply decrypt swap just
using "secretkey". We don't actually need a LUKS header, so we can save
ourselves some pointless disk writes and identifiability.

In addition, I wouldn't have made the awful mistake of backing up my swap partition's LUKS header instead of my zpool's. May my data rest in peace.

Creating and then erasing the key relies on the disk erasing data
correctly, and otherwise allows attackers to simply decrypt swap just
using "secretkey". We don't actually need a LUKS header, so we can save
ourselves some pointless disk writes and identifiability.

In addition, I wouldn't have made the awful mistake of backing up my swap partition's LUKS header instead of my zpool's. May my data rest in peace.
@joachifm
Copy link
Contributor

joachifm commented Jul 6, 2017

See also #25999

@edef1c
Copy link
Member Author

edef1c commented Jul 7, 2017

*shrug*
That doesn't look like it'll get merged anytime soon, and I see no reason to close this PR.
I have no interest in adding complexity, whereas that PR adds a bunch of it along with a breaking config change.

@Mic92
Copy link
Member

Mic92 commented Jul 7, 2017

Yeah probably giving too much choices is sometimes a bad thing in security.

@joachifm
Copy link
Contributor

joachifm commented Jul 8, 2017

cc @abbradar

@abbradar
Copy link
Member

abbradar commented Jul 9, 2017

Quick heads-up -- I won't be able to work on NixOS (and generally be available online) for two more weeks.

@joachifm
Copy link
Contributor

joachifm commented Jul 9, 2017

I propose we merge this first, then. Seems like an obvious improvement & doesn't preclude any of the other enhancements.

@ghost
Copy link

ghost commented Jul 9, 2017

@edef1c:

I have no interest in adding complexity, whereas that PR adds a bunch of it along with a breaking config change.

To be true on this #25999 does not break the user config because it uses coercedTo meaning that randomEncryption = true stays a valid setting which is mapped to randomEncryption.enable = true.

@grahamc
Copy link
Member

grahamc commented Jul 26, 2017

I think we should merge this. @GeNTooFReaK are you saying we shouldn't? IMO this is a serious bug.

@grahamc grahamc added this to the 17.09 milestone Jul 26, 2017
@ghost
Copy link

ghost commented Jul 26, 2017

@grahamc I'm totally in to merge this ASAP. I just wanted to note that #25999 would be nice too (and it does not break config), because it enables me and others to change the cipher for swap to something more performant which is a great benefit especially on low-end hardware (without AES-NI). I'm speaking of 20 MB/s with the default aes-xts-plain64 vs. 50 MB/s with serpent-xts-plain64 on my Intel Atom Netbook. And you know, faster swap makes life much less painful.

@fpletz fpletz added 1.severity: security Issues which raise a security issue, or PRs that fix one 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Jul 26, 2017
@fpletz fpletz merged commit 10c6df2 into NixOS:master Jul 26, 2017
@grahamc
Copy link
Member

grahamc commented Jul 26, 2017

Gotcha. Thank you @GeNTooFReaK!

@edef1c edef1c deleted the plain-random-encryption branch July 27, 2017 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.severity: security Issues which raise a security issue, or PRs that fix one 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants