Skip to content

Comments

efi, efi/preinstall: Allow opt-in to secure boot being in user mode#508

Open
chrisccoulson wants to merge 1 commit intocanonical:masterfrom
chrisccoulson:preinstall-allow-user-mode-optin
Open

efi, efi/preinstall: Allow opt-in to secure boot being in user mode#508
chrisccoulson wants to merge 1 commit intocanonical:masterfrom
chrisccoulson:preinstall-allow-user-mode-optin

Conversation

@chrisccoulson
Copy link
Collaborator

@chrisccoulson chrisccoulson commented Feb 18, 2026

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: #502

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
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question

// 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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean we need to use WithSecureBootUserMode for pre UC26 core systems?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@valentindavid valentindavid Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User mode is not supported

3 participants