Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add question about how kernel modules are signed #337

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ This matches https://github.com/rhboot/shim/releases/tag/15.7 and contains the a
*******************************************************************************
[your text here]

*******************************************************************************
### Do you use an ephemeral key for signing kernel modules?
### If not, please describe how you ensure that one kernel build does not load modules built for another kernel.
*******************************************************************************
Copy link

Choose a reason for hiding this comment

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

I disagree with this requirement.

Ubuntu does not only use ephemeral key for signing kernel modules. And it by default trusts: ephemeral build-time, 3rd-party driver signing key, Livepatch signing key, and MOK signing keys.

In practice MOK signing key is always the same for all kernels.

Which key is used and trusted, and whether it is chained to CA is not at all interesting.

Instead the following rules should be followed instead

  1. Ensure unique modversions are set for each distinct kernel build https://www.kernel.org/doc/html/latest/admin-guide/module-signing.html#administering-protecting-the-private-key
  2. Ensure that lockdown=integrity by default prohibits bypassing --force-vermagic

This is easily checked by comparing two distinct abi builds, running modinfo on the modules from both and checking that vermagic is different.

Note that there are additional abi checks that prevent modules loading from incompatible builds of kernel on top of that (but those use non-cryptographically secure CRC).

I request to revert this requirement, as it is crafted without full consideration of existing keys in use for existing secureboot signed keys in all kernels from all vendors, which today all use the same key for different abis and already prevent ability to load a kernel module from one kernel abi on the other abi. If that is incorrect for any vendor, it must be resolved by correctly bumping EXTRAVERSION/LOCALVERSION in every published build.

Also we should ensure all certificates used for kernel module signing, have the extension set that such certs are for module signing only.

Copy link

Choose a reason for hiding this comment

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

cc: @jsetje @steve-mcintyre i disagree with this wording being merged, without reviews or approvals from at least 2 different kernel maintainers. and the proposer of this change is not a kernel maintainer themselves.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I believe modversions is the wrong thing, because CONFIG_MODVERSIONS is the CRC mechanism, you want to ensure each kernel build has a separate EXTRAVERSION or CONFIG_LOCALVERSION.

I'm wary of allowing people to reuse kernel ABIs because they think it is still the same, they can't really proof it or have the tooling, hence generally guiding them to something that works is what I'm looking for.

Copy link
Collaborator

@dennis-tseng99 dennis-tseng99 Nov 5, 2023

Choose a reason for hiding this comment

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

I'm concerned about the memory life or size of server. Instead of using Canonical key, for each Livepatch operation, MOK needs to add into or erase from the database of keys, which might reduce the usage life of NVRAM.

[your text here]

*******************************************************************************
### If you use vendor_db functionality of providing multiple certificates and/or hashes please briefly describe your certificate setup.
### If there are allow-listed hashes please provide exact binaries for which hashes are created via file sharing service, available in public with anonymous access for verification.
Expand Down