efi, efi/preinstall: Allow opt-in to secure boot being in user mode#508
Open
chrisccoulson wants to merge 1 commit intocanonical:masterfrom
Open
efi, efi/preinstall: Allow opt-in to secure boot being in user mode#508chrisccoulson wants to merge 1 commit intocanonical:masterfrom
chrisccoulson wants to merge 1 commit intocanonical:masterfrom
Conversation
The preinstall checks currently require a system to be in deployed mode (for UEFI versions >= 2.5). Relax this to allow an opt-in to user mode for systems that run UEFI versions >= 2.5 but where the firmware settings don't permit enabling deployed mode. To support this, a new WithSecureBootUserMode option is added for AddPCRProfile. If this option is supplied on a system that is in user mode, 2 branches will be created. One of these will include the user mode related measurements and the other branch will be for deployed mode, which allows a system to transition from user mode to deployed mode without requiring a recovery key. This is an opt-in rather than automatic to avoid the scenario where a system is initially in deployed mode but a later firmware configuration change reverts to user mode, the user enters their recovery key on the next boot and then snapd automatically repairs with a PCR profile that includes the newly degraded setting. In this case, we want the user to explicitly opt-in to this as an acknowledgement that the firmware configuration has been changed. Fixes: FR-12184 Fixes: canonical#502
pedronis
reviewed
Feb 20, 2026
| // Backward compliance: On Ubuntu Core not using preinstall checks, | ||
| // the firmware might be UEFI 2.5 compliant but not be in deployed mode. | ||
| // In that case we should still expect those measurements due to the mode. | ||
| if data, ok := e.Data.(*tcglog.EFIVariableData); ok { |
Collaborator
There was a problem hiding this comment.
does this mean we need to use WithSecureBootUserMode for pre UC26 core systems?
Collaborator
There was a problem hiding this comment.
I wonder if we should always use it also on UC26. I expect a lot of customers will not be able to update to 26.04 because a lot of hardware is not yet ready. And maybe plan it for UC28.
Collaborator
There was a problem hiding this comment.
My understanding is that Hybrid will allow users to override this. But Core will not be able to do that, so it has to be automatic.
As long as we make Hybrid users able to ignore this, we should also make Core automatically accept it.
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.
The preinstall checks currently require a system to be in deployed mode
(for UEFI versions >= 2.5). Relax this to allow an opt-in to user mode
for systems that run UEFI versions >= 2.5 but where the firmware
settings don't permit enabling deployed mode.
To support this, a new
WithSecureBootUserModeoption is added forAddPCRProfile. If this option is supplied on a system that is in usermode, 2 branches will be created. One of these will include the user
mode related measurements and the other branch will be for deployed
mode, which allows a system to transition from user mode to deployed
mode without requiring a recovery key.
This is an opt-in rather than automatic to avoid the scenario where a
system is initially in deployed mode but a later firmware configuration
change reverts to user mode, the user enters their recovery key on the
next boot and then snapd automatically repairs with a PCR profile that
includes the newly degraded setting. In this case, we want the user to
explicitly opt-in to this as an acknowledgement that the firmware
configuration has been changed.
Fixes: FR-12184
Fixes: #502