Skip to content

Enable CONFIG_INTEGRITY_CA_MACHINE_KEYRING for DKMS module signing under Secure Boot + lockdown #743

@doublegate

Description

@doublegate

Pre-flight checklist

  • I have searched existing issues/PRs and this has not been requested before.
  • I have read the Contributing Guidelines.

Request type

  • New patch / patchset inclusion
  • Kernel config change (enable/disable option)
  • New kernel variant
  • Scheduler tuning / addition
  • Compiler / LTO / PGO optimization
  • Security hardening
  • Driver or hardware enablement
  • Other

Summary

Enable CONFIG_INTEGRITY_CA_MACHINE_KEYRING=y in the CachyOS kernel config (mainline and LTS variants).

This option allows CA certificates enrolled via UEFI Secure Boot db or shim MOK to be loaded into the kernel's machine keyring, making them trusted for kernel module signature verification. Without it, enrolled certificates land only in the platform keyring, which is used solely for kernel image (EFI binary) verification and is not consulted during module loading.

Motivation / use case

On CachyOS with Secure Boot enabled and lockdown=integrity active, DKMS-built kernel modules (e.g., VMware Workstation vmmon/vmnet, NVIDIA out-of-tree drivers, openrazer, etc.) cannot be loaded even after correctly signing them with a key enrolled via sbctl or shim MOK.

The root cause: CONFIG_INTEGRITY_CA_MACHINE_KEYRING is not set, so no CA certificates from UEFI db or MokListRT are placed in the machine keyring. The machine keyring is initialized at boot but remains empty, causing all DKMS module signatures to be treated as unverified, which lockdown=integrity then blocks with "unsigned module loading is restricted."

This affects any user running:

  • Secure Boot (sbctl or shim/MOK-based enrollment)
  • lockdown=integrity (either via cmdline or hardened profile)
  • Any out-of-tree DKMS module (VMware, VirtualBox, openrazer, custom drivers, etc.)

The only current workaround is to remove lockdown=integrity from the kernel cmdline, which weakens the kernel hardening posture that CachyOS users reasonably expect to keep alongside Secure Boot.

Fedora and Ubuntu ship with this option enabled as standard. It is part of their recommended Secure Boot + DKMS module signing workflow.

Patch / upstream reference (if available)

Kernel config option: CONFIG_INTEGRITY_CA_MACHINE_KEYRING
Introduced: Linux 5.17 (commit 2a2a1d988b7f "integrity: add a reference to platform keyring in the machine keyring")
Kconfig location: security/integrity/Kconfig
Depends on: CONFIG_INTEGRITY_MACHINE_KEYRING=y (already set in CachyOS)

Fedora kernel config reference:
https://src.fedoraproject.org/rpms/kernel/blob/main/f/kernel-x86_64-fedora.config
(search: CONFIG_INTEGRITY_CA_MACHINE_KEYRING=y)

No patch required — single config line addition.

Testing / benchmarks

Tested on CachyOS (x86_64_v3), kernel 6.19.5-3-cachyos and 6.18.15-3-cachyos-lts:

  1. sbctl enrolled a CA-flagged certificate (basicConstraints=critical,CA:TRUE) into UEFI Secure Boot db
  2. shim 15.8 installed with MOK enrollment of a dedicated module signing key (CN=VMware Module Signing MOK)
  3. vmmon.ko.zst and vmnet.ko.zst signed with sha512 using the enrolled MOK key
  4. After boot: sudo keyctl show %:.machine confirms machine keyring is empty
  5. journalctl -b -k | grep -i moklist — no MOKLIST entries loaded
  6. modprobe fails: "Lockdown: modprobe: unsigned module loading is restricted"

Expected behavior with CONFIG_INTEGRITY_CA_MACHINE_KEYRING=y: CA certs from UEFI db / MokListRT are placed in the machine keyring at boot, module signatures verified against them, DKMS modules load successfully under lockdown=integrity.

Additional context

CONFIG_INTEGRITY_MACHINE_KEYRING is already enabled in CachyOS kernels — the machine keyring infrastructure is there, just not populated from enrolled CA certs. Enabling CONFIG_INTEGRITY_CA_MACHINE_KEYRING is the minimal change to make the full Secure Boot → MOK enrollment → DKMS signing workflow function as expected.

No known conflicts with existing CachyOS patches. Pure config addition.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions