pcrlock: add support for unlocking a root fs with a pcrlock file#30130
Merged
bluca merged 4 commits intosystemd:mainfrom Jan 23, 2024
Merged
pcrlock: add support for unlocking a root fs with a pcrlock file#30130bluca merged 4 commits intosystemd:mainfrom
bluca merged 4 commits intosystemd:mainfrom
Conversation
|
We had successfully released a new major release. We are no longer in a development freeze phase. |
6d97d44 to
17f3512
Compare
17f3512 to
6079f80
Compare
6079f80 to
9c2bc6a
Compare
9c2bc6a to
52169e7
Compare
52169e7 to
059e112
Compare
80e66b9 to
b6a8f87
Compare
b6a8f87 to
54b10af
Compare
b25010e to
0a6e69b
Compare
e27af99 to
fd81129
Compare
2f6fe67 to
70d96c6
Compare
bluca
reviewed
Jan 19, 2024
bluca
reviewed
Jan 19, 2024
bluca
reviewed
Jan 19, 2024
bluca
reviewed
Jan 19, 2024
bluca
reviewed
Jan 19, 2024
bluca
reviewed
Jan 19, 2024
bluca
reviewed
Jan 19, 2024
70d96c6 to
667d8a5
Compare
Member
Author
|
force pushed a new version with some points addressed, but see discussions above. |
667d8a5 to
452486c
Compare
bluca
approved these changes
Jan 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We store the pcrlock policy JSON file in /var/. We need it to unlock LUKS devices that are locked to pcrlock. That means we have to copy the pcrlock policy file somewhere better to be able to unlock the root fs itself (where /var/ typically resides), to avoid the cyclic dependency.
Let's address this by wrapping the policy file in a credential, and writting it to /loader/credentials in the ESP. Then sd-stub will pick it up, and pass it to the initrd where we can consume it.
We disable encryption/authentication for the credential, since we need to access it to unlock TPM-locked objects, and hence cannot lock it to TPM itself. We already had a codepath for that in place, to cover for TPM-less systems, but refused to enable the codepath if we detected a TPM present (simple in order to refuse unauthenticated credentials). Hence we relax the rules here a bit and allow the data to be consumed even with disabled encryption/authentication on explicit request.
All in all behaviour is fully automatic.
(As preparation this converts a good chunk of the tpm2 codebase to use
struct iovecfor maintaining "blobs" of arbitrary data, instead of manual pairs of void* and size_t.)