Skip to content

dkms: reinstate --enroll-key#322

Merged
evelikov merged 5 commits intodkms-project:masterfrom
evelikov:enroll-key
Mar 26, 2023
Merged

dkms: reinstate --enroll-key#322
evelikov merged 5 commits intodkms-project:masterfrom
evelikov:enroll-key

Conversation

@evelikov
Copy link
Collaborator

This is a Debian/Ubuntu patch, the following is their original commit message:

When a brand new secureboot key is created, and it hasn't been
previously enrolled as a mok key, it will be rejected by the
kernel. After creating a new key, one should be enrolling it.

Side note: The update-secureboot-policy script seemingly originates from Ubuntu, where Debian has an ancient copy, which lacks both --new-key and --enroll-key.

Fixes: 3ca52f8 ("Fix signing on ubuntu & debian (#244)")

@xuzhen @anbe42 jfyi

@xuzhen
Copy link
Collaborator

xuzhen commented Mar 26, 2023

If we're going to do this on Ubuntu, what about other distros? The behavior of dkms on each distribution should be as consistent as possible.

And before 3ca52f8, dkms will checked if secureboot was enabled before enrolling the key. Without those code, update-secureboot-policy --enroll-key will show unnecessary errors in output on platforms that do not enable or support secureboot.

@evelikov
Copy link
Collaborator Author

Welcome back @xuzhen p/

Yes, ideally dkms will have zero knowledge about distribution specifics.

From a quick look the vast majority are caused by our open-coding of the installation/copy/strip/sign stages. Off the top of my head all of that can be avoided by using the kernel module_install rule. I am itching to give that a try, although it has a much greater chance of causing issues - hence the quick fix here.

The patch is taken as-is from the Debian repo, so it should not cause (too many) errors. CI also looks happy so we can fix any issues as follow-up.

@xuzhen
Copy link
Collaborator

xuzhen commented Mar 26, 2023

I think we should mention this special handling for Ubuntu in README.md

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This is a Debian/Ubuntu patch, the following is their original commit
message:

 When a brand new secureboot key is created, and it hasn't been
 previously enrolled as a mok key, it will be rejected by the
 kernel. After creating a new key, one should be enrolling it.

Side note: The update-secureboot-policy script seemingly originates from
Ubuntu, where Debian has an ancient copy, which lacks both --new-key and
--enroll-key.

[Emil Velikov]
 - add side note, remove EFI messages from test output

Fixes: 3ca52f8 ("Fix signing on ubuntu & debian (dkms-project#244)")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
The tool hasn't been used on Debian for a while now. Update the readme
to be less misleading.

Fixes: 985bfd5 ("Fix signing without custom key on Debian")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
@evelikov
Copy link
Collaborator Author

Looking at the README - it had a few typos + was misleadingly mentioning Debian. Thanks o/

@evelikov evelikov requested a review from xuzhen March 26, 2023 16:47
@evelikov evelikov merged commit 0e12fe1 into dkms-project:master Mar 26, 2023
@evelikov evelikov deleted the enroll-key branch March 26, 2023 18:25
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.

2 participants