Skip to content

fix: enable IMA so MOK-signed modules load under Secure Boot#863

Open
mbocevski wants to merge 1 commit into
CachyOS:masterfrom
mbocevski:enable-ima-secure-boot
Open

fix: enable IMA so MOK-signed modules load under Secure Boot#863
mbocevski wants to merge 1 commit into
CachyOS:masterfrom
mbocevski:enable-ima-secure-boot

Conversation

@mbocevski
Copy link
Copy Markdown

@mbocevski mbocevski commented May 31, 2026

Enables IMA across all kernel variants so MOK keys get loaded into the .machine keyring. Without it, arch_ima_get_secureboot() is a stub that returns false, load_uefi_certs() returns before load_moklist_certs(), and MOK-signed DKMS modules (e.g. openrazer) can't load under Secure Boot.

Same change already done for the Fedora packaging in copr-linux-cachyos (a0407947).

Scope of the behavior change: the arch IMA policy is only loaded when Secure Boot is enabled (arch_get_ima_policy() gates on arch_ima_get_secureboot()), so non-Secure-Boot systems are unaffected. Under Secure Boot it adds measure rules and calls set_module_sig_enforced()/set_kexec_sig_enforced() — i.e. it requires signed modules/kexec images. On a Secure Boot setup already running lockdown=integrity that is a no-op (lockdown enforces the same thing); on Secure Boot without lockdown it newly enforces signed modules. This kernel does not auto-enter lockdown under Secure Boot (LOCK_DOWN_KERNEL_FORCE_NONE), so that case is worth a heads-up.

Done as a config change in every variant (the resolved IMA block), matching how config options are flipped here (e.g. #836). b2sums/.SRCINFO still need regenerating with srcinfo.sh.

Tested on 7.0.10-2: .machine is populated and the previously-blocked modules load. Full writeup and logs in #862.

Docs: a companion wiki section (DKMS/MOK module signing under Secure Boot) is drafted in CachyOS/wiki#482, blocked on this PR.

linux-cachyos builds with IMA disabled, so arch_ima_get_secureboot() is a
stub that returns false and load_uefi_certs() returns before
load_moklist_certs(). MOK keys are never loaded into the .machine keyring,
so MOK-signed modules (DKMS: openrazer, nvidia-dkms, etc.) cannot load
under Secure Boot.

Enable IMA in the config of all kernel variants, matching the Fedora
packaging fix in copr-linux-cachyos (a0407947).

The arch IMA policy is only loaded when Secure Boot is enabled
(arch_get_ima_policy() gates on arch_ima_get_secureboot()), so non-Secure
-Boot systems are unaffected. Under Secure Boot it adds measure rules and
calls set_module_sig_enforced()/set_kexec_sig_enforced(): it requires signed
modules/kexec images. On a Secure Boot setup already running
lockdown=integrity this is a no-op (lockdown enforces the same); on Secure
Boot without lockdown it newly enforces signed modules.

Closes CachyOS#862
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.

1 participant