efi/preinstall,tpm2: Don't fail due to lack of TPM_CAP_AUTH_POLICIES#534
Merged
chrisccoulson merged 1 commit intocanonical:masterfrom Apr 9, 2026
Merged
Conversation
TPMs based on versions of the refeference library older than v1.38 may not implement TPM_CAP_AUTH_POLICICES. The preinstall checks currently rely on this in order to determine whether TPM hierarchies have an authorization policy set. The existence of an authorization policy isn't relevant if the hierarcy's authorization value isn't set, as the empty authorization value can be used to clear the policy. In the case where the authorization value is unset, there's no point in checking for the existence of a policy. Only check for the existence of an authorization policy for the lockout hierarchy if it has an authorization value. In this case, the presence of a policy is presented in the error message as additional information. We take ownerhip of the lockout hierarchy in tpm2.Connection.EnsureProvisioned, and for now, this function will clear any policy before the authorization value is set. A subsequent PR will set a more appropriate policy based on the requirement to be able to rotate the authorization value safely during reprovisioning. Fixes: canonical#408
valentindavid
approved these changes
Apr 9, 2026
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.
TPMs based on versions of the refeference library older than v1.38 may
not implement
TPM_CAP_AUTH_POLICICES. The preinstall checks currentlyrely on this in order to determine whether TPM hierarchies have an
authorization policy set.
The existence of an authorization policy isn't relevant if the
hierarcy's authorization value isn't set, as the empty authorization
value can be used to clear the policy. In the case where the
authorization value is unset, there's no point in checking for the
existence of a policy.
Only check for the existence of an authorization policy for the lockout
hierarchy if it has an authorization value. In this case, the presence
of a policy is presented in the error message as additional information.
We take ownerhip of the lockout hierarchy in
tpm2.Connection.EnsureProvisioned, and for now, this function will clearany policy before the authorization value is set. A subsequent PR will
set a more appropriate policy based on the requirement to be able to
rotate the authorization value safely during reprovisioning.
Fixes: #408