always call mokutil with --timeout -1 when enrolling dkms keys

Bug #1856422 reported by Steve Langasek on 2019-12-15
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
shim-signed (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Eoan
Undecided
Unassigned
ubiquity (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Unassigned
Eoan
Undecided
Unassigned

Bug Description

[SRU Justification]
The version of MokManager currently in all releases supports a MokTimeout variable, which can be set with mokutil --timeout, to control how long MokManager waits for input instead of having a hard-coded timeout of 10 seconds.

If the timeout is reached on boot with no input, MokManager clears the MOK requests and passes control back to shim, which falls back to booting the OS.

So if you miss seeing MokManager on boot, you have to restart the key enrollment process from the OS and reboot again.

When we are invoking mokutil automatically on behalf of the user as part of key generation for dkms modules, we should disable the timeout. We should never leave the user with broken dkms modules on the system because they were looking away from the console at the wrong point in time during a reboot.

[Test case]
1. On a system with SecureBoot enabled, install the virtualbox-dkms package.
2. Set a password to use for MOK enrollment.
3. Reboot.
4. Observe that there is a countdown on MokManager. Let the timer expire.
5. Install the shim-signed package from -proposed.
6. Purge the virtualbox-dkms and dkms packages.
7. sudo rm -rf /var/lib/shim-signed.
8. Repeat steps 1 through 3.
9. Observe that there is no countdown on MokManager, and that it waits indefinitely for input (confirm that this is the case by sitting at the screen for at least 1 minute).

[Regression potential]
If a wrong version of mokutil is called with this additional argument and doesn't support it and as a result mokutil fails, this could result in users not having their MOK enrolled who otherwise would have.

This prevents systems which have a pending MOK enrollment due to dkms from rebooting unattended back to Ubuntu. If anyone is automating configuration of dkms/shim, during an install or otherwise, and expecting the system to reboot back to Ubuntu without intervention at the console, this will stop working. However, such a system is broken with respect to dkms modules and SecureBoot anyway; the user should either not install dkms modules, or plan for handling the MOK request at the console (serial console or otherwise) on the next reboot.

If the user does not have console access to the system but does have power access, they can still bypass MokManager by power cycling the system, again giving them a system which is booted but does not properly support the dkms modules under SecureBoot.

Related branches

Steve Langasek (vorlon) on 2019-12-15
description: updated
Changed in ubiquity (Ubuntu Eoan):
status: New → Won't Fix
Steve Langasek (vorlon) on 2019-12-15
Changed in shim-signed (Ubuntu Bionic):
status: New → In Progress
Changed in shim-signed (Ubuntu):
status: New → Fix Committed
description: updated
Steve Langasek (vorlon) on 2019-12-15
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package shim-signed - 1.40

---------------
shim-signed (1.40) focal; urgency=medium

  * Pass --timeout -1 to mokutil so that users don't end up with broken
    systems by missing MokManager on reboot after install. LP: #1856422.
  * Add a versioned dependency on the mokutil that introduces --timeout.

 -- Steve Langasek <email address hidden> Sat, 14 Dec 2019 20:26:42 -0800

Changed in shim-signed (Ubuntu):
status: Fix Committed → Fix Released
Łukasz Zemczak (sil2100) wrote :

The change is good and I'd be willing to accept it, but before I do so I wanted to consult the SRU version number first. You have used 1.39.1, but currently 1.39 is present both in eoan and disco. I know disco goes EOL on January next year, but knowing our bad luck, I'm worried that if some emergency upload is required, the version number might be problematic. On the other hand, I guess in this very improbable case we could just use ~ for disco.

Anthony Wong (anthonywong) wrote :

On Focal MokManager doesn't come up on reboot, I found mokutil doesn't allow --timeout be used with --import. So either call mokutil --timeout in a second command, or need https://github.com/lcp/mokutil/pull/26/commits/8dc9f57b6fe5ca0d459c9aec2da35ef8f36cf94b# to fix mokutil.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in shim-signed (Ubuntu Eoan):
status: New → Confirmed
Changed in ubiquity (Ubuntu Bionic):
status: New → Confirmed
Changed in ubiquity (Ubuntu):
status: New → Confirmed

Hello Steve, or anyone else affected,

Accepted shim-signed into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/shim-signed/1.39.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in shim-signed (Ubuntu Eoan):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-eoan
Changed in shim-signed (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Timo Aaltonen (tjaalton) wrote :

Hello Steve, or anyone else affected,

Accepted shim-signed into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/shim-signed/1.37~18.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Steve Langasek (vorlon) wrote :

shim-signed is verification-failed for bionic because the versioned dependency on mokutils is not satisfied (LP: #1862632).

tags: added: verification-failed-bionic
removed: verification-needed-bionic
Łukasz Zemczak (sil2100) wrote :

Hello Steve, or anyone else affected,

Accepted shim-signed into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/shim-signed/1.37~18.04.5 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed-bionic
removed: verification-failed-bionic
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers