Repository navigation
linux: generate deterministic module signatures and certificates - #571181
Merged
Merged
Conversation
emilazy
force-pushed
the
wip-emily/push-xllppwszomnw
branch
from
October 7, 2026 05:21
d2b6bc7 to
39a5b71
Compare
nixpkgs-ci
Bot
requested review from
a team,
Atemu,
AxerTheAxe,
JerrySM64,
andir,
eljamm,
lovesegfault,
moni-dz,
thiagokokada,
thoughtpolice and
zzzsyyy
and removed request for
a team
October 7, 2026 05:32
zowoq
reviewed
Oct 7, 2026
| sed 's/$/\.cer/' modules.order | xargs -d'\n' cat > modules.cer | ||
| sed 's/$/\.cer/' modules.order | xargs -d'\n' rm | ||
| '' | ||
| else |
Contributor
There was a problem hiding this comment.
The 5.10/5.15 kernels have been been removed so these conditions could be removed. #570647
Member
Author
There was a problem hiding this comment.
Wonderful, thanks! Dropped this and the conditional kernel configuration.
emilazy
force-pushed
the
wip-emily/push-omlskzuxuzxs
branch
from
October 8, 2026 17:21
d0b7646 to
c2a8db2
Compare
emilazy
force-pushed
the
wip-emily/push-xllppwszomnw
branch
from
October 8, 2026 17:21
39a5b71 to
14e472b
Compare
emilazy
force-pushed
the
wip-emily/push-omlskzuxuzxs
branch
from
October 10, 2026 02:00
c2a8db2 to
8a3d399
Compare
emilazy
force-pushed
the
wip-emily/push-xllppwszomnw
branch
from
October 10, 2026 02:00
14e472b to
7c25b2e
Compare
emilazy
force-pushed
the
wip-emily/push-omlskzuxuzxs
branch
from
October 10, 2026 15:34
8a3d399 to
70b7136
Compare
emilazy
force-pushed
the
wip-emily/push-xllppwszomnw
branch
from
October 10, 2026 15:34
7c25b2e to
18f1ad9
Compare
3 of 13 tasks
welles
added a commit
to welles/nixos-config
that referenced
this pull request
Oct 21, 2026
nixpkgs' new-lg4ff splices kernelModuleMakeFlags unquoted into bash. Since NixOS/nixpkgs#571181 they contain the module signing rule `cmd_sign=…/kmodigest$(space)$@`, and bash runs `$(space)` as a command: "space: command not found", exit code 127. Build the package with the flags quoted and add it directly instead of through hardware.new-lg4ff.enable, which only adds the package and loads hid-logitech-new. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nixos-cuda-channel-updater Bot
pushed a commit
to nixos-cuda/nixpkgs
that referenced
this pull request
Oct 21, 2026
The custom installPhase copied acpi_call.ko manually, bypassing scripts/Makefile.modinst. The module was therefore not stripped, not compressed, and — since the kernel now signs modules deterministically with kmodigest (PR NixOS#571181) — not signed and missing the per-module certificate that the kmod aggregator expects next to every external module, breaking the module closure of hosts using acpi_call. Use the upstream install target, which runs the kernel's modules_install, so modinst strips, signs and compresses the module and emits acpi_call.ko.cer alongside it. Assisted-by: Kilo Code (GLM-5.3-Flash)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The bundled Makefile-footer.gmk passes "CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL=" to the kernel's modules_install, so the modules were installed unsigned and without the per-module certificate that the kmod aggregator expects next to every external module since PR NixOS#571181. Set VBOX_ALLOW_MODULE_SIGNING=1 and propagate kernelModuleMakeFlags (which routes the signing rule to the deterministic kmodigest), so modinst signs the modules and emits vboxdrv.ko.cer and friends alongside them. Assisted-by: Kilo Code (GLM-5.3-Flash) (cherry picked from commit 7bd4fa6)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The custom installPhase copied acpi_call.ko manually, bypassing scripts/Makefile.modinst. The module was therefore not stripped, not compressed, and — since the kernel now signs modules deterministically with kmodigest (PR NixOS#571181) — not signed and missing the per-module certificate that the kmod aggregator expects next to every external module, breaking the module closure of hosts using acpi_call. Use the upstream install target, which runs the kernel's modules_install, so modinst strips, signs and compresses the module and emits acpi_call.ko.cer alongside it. Assisted-by: Kilo Code (GLM-5.3-Flash) (cherry picked from commit c270cc0)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The install phase copied system76.ko into the output by hand, bypassing the Kbuild module installation. Since NixOS#571181, kernelModuleMakeFlags makes Kbuild sign each module with kmodigest during modules_install, which also writes a certificate next to the module, and aggregateModules merges the certificates of all external modules into modules.cer. The hand-copied module has neither, so building a NixOS system with hardware.system76.enableAll fails: cat: misc/system76.ko.cer: No such file or directory The upstream Makefile has no install target, so call the Kbuild modules_install target directly, as suggested for zenpower in NixOS#575192. It strips, signs, and compresses the module and writes its certificate. Keep the module under misc and leave depmod to aggregateModules. Set INSTALL_MOD_STRIP=1, as compression now happens before the strip phase, which used to remove the debug information. The hwdb file moves to postInstall. Assisted-by: Claude (claude-opus-5-5) (cherry picked from commit e5d3094)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The install phase copied system76-io.ko and system76-thelio-io.ko into the output by hand, bypassing the Kbuild module installation. Since NixOS#571181, kernelModuleMakeFlags makes Kbuild sign each module with kmodigest during modules_install, which also writes a certificate next to the module, and aggregateModules merges the certificates of all external modules into modules.cer. The hand-copied modules have neither, so building a NixOS system with hardware.system76.enableAll fails: cat: misc/system76-thelio-io.ko.cer: No such file or directory cat: misc/system76-io.ko.cer: No such file or directory The upstream Makefile has no install target, so call the Kbuild modules_install target directly, as suggested for zenpower in NixOS#575192. It strips, signs, and compresses the modules and writes their certificates. Keep the modules under misc and leave depmod to aggregateModules. Set INSTALL_MOD_STRIP=1, as compression now happens before the strip phase, which used to remove the debug information. Assisted-by: Claude (claude-opus-5-5) (cherry picked from commit 8043407)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
…nstall Installing the module by hand bypasses Kbuild's module installation flow, which since NixOS#571181 is what signs each module with kmodigest and installs its per-module certificate. The package therefore only produced `framework_laptop.ko`, and building `system.modulesTree` failed while concatenating the certificates of external modules: cat: extra/framework_laptop.ko.cer: No such file or directory Install via `modules_install` so the module is signed and its certificate is installed alongside it, matching the other kernel module packages fixed in this way. See NixOS#575192. (cherry picked from commit e81ffa2)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The bundled Makefile-footer.gmk passes "CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL=" to the kernel's modules_install, so the modules were installed unsigned and without the per-module certificate that the kmod aggregator expects next to every external module since PR NixOS#571181. Set VBOX_ALLOW_MODULE_SIGNING=1 and propagate kernelModuleMakeFlags (which routes the signing rule to the deterministic kmodigest), so modinst signs the modules and emits vboxdrv.ko.cer and friends alongside them. Assisted-by: Kilo Code (GLM-5.3-Flash) (cherry picked from commit 7bd4fa6)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The custom installPhase copied acpi_call.ko manually, bypassing scripts/Makefile.modinst. The module was therefore not stripped, not compressed, and — since the kernel now signs modules deterministically with kmodigest (PR NixOS#571181) — not signed and missing the per-module certificate that the kmod aggregator expects next to every external module, breaking the module closure of hosts using acpi_call. Use the upstream install target, which runs the kernel's modules_install, so modinst strips, signs and compresses the module and emits acpi_call.ko.cer alongside it. Assisted-by: Kilo Code (GLM-5.3-Flash) (cherry picked from commit c270cc0)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The install phase copied system76.ko into the output by hand, bypassing the Kbuild module installation. Since NixOS#571181, kernelModuleMakeFlags makes Kbuild sign each module with kmodigest during modules_install, which also writes a certificate next to the module, and aggregateModules merges the certificates of all external modules into modules.cer. The hand-copied module has neither, so building a NixOS system with hardware.system76.enableAll fails: cat: misc/system76.ko.cer: No such file or directory The upstream Makefile has no install target, so call the Kbuild modules_install target directly, as suggested for zenpower in NixOS#575192. It strips, signs, and compresses the module and writes its certificate. Keep the module under misc and leave depmod to aggregateModules. Set INSTALL_MOD_STRIP=1, as compression now happens before the strip phase, which used to remove the debug information. The hwdb file moves to postInstall. Assisted-by: Claude (claude-opus-5-5) (cherry picked from commit e5d3094)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
The install phase copied system76-io.ko and system76-thelio-io.ko into the output by hand, bypassing the Kbuild module installation. Since NixOS#571181, kernelModuleMakeFlags makes Kbuild sign each module with kmodigest during modules_install, which also writes a certificate next to the module, and aggregateModules merges the certificates of all external modules into modules.cer. The hand-copied modules have neither, so building a NixOS system with hardware.system76.enableAll fails: cat: misc/system76-thelio-io.ko.cer: No such file or directory cat: misc/system76-io.ko.cer: No such file or directory The upstream Makefile has no install target, so call the Kbuild modules_install target directly, as suggested for zenpower in NixOS#575192. It strips, signs, and compresses the modules and writes their certificates. Keep the modules under misc and leave depmod to aggregateModules. Set INSTALL_MOD_STRIP=1, as compression now happens before the strip phase, which used to remove the debug information. Assisted-by: Claude (claude-opus-5-5) (cherry picked from commit 8043407)
Mic92
pushed a commit
to Mic92/nixpkgs
that referenced
this pull request
Oct 22, 2026
…nstall Installing the module by hand bypasses Kbuild's module installation flow, which since NixOS#571181 is what signs each module with kmodigest and installs its per-module certificate. The package therefore only produced `framework_laptop.ko`, and building `system.modulesTree` failed while concatenating the certificates of external modules: cat: extra/framework_laptop.ko.cer: No such file or directory Install via `modules_install` so the module is signed and its certificate is installed alongside it, matching the other kernel module packages fixed in this way. See NixOS#575192. (cherry picked from commit e81ffa2)
4 of 13 tasks
B4dM4n
added a commit
to B4dM4n/nixpkgs
that referenced
this pull request
Oct 23, 2026
The install already runs the kernel's `modules_install`, but without a `cmd_sign` override the module was left unsigned and without the per-module certificate that the kmod aggregator expects next to every external module since PR NixOS#571181. Pass `kernelModuleMakeFlags`, which routes the signing rule to the deterministic kmodigest. Assisted-by: Kilo Code (GLM-5.3-Flash)
B4dM4n
added a commit
to B4dM4n/nixpkgs
that referenced
this pull request
Oct 23, 2026
The install already runs the kernel's `modules_install`, but without a `cmd_sign` override the module was left unsigned and without the per-module certificate that the kmod aggregator expects next to every external module since PR NixOS#571181. Pass `kernelModuleMakeFlags`, which routes the signing rule to the deterministic kmodigest. Assisted-by: Kilo Code (GLM-5.3-Flash)
B4dM4n
added a commit
to B4dM4n/nixpkgs
that referenced
this pull request
Oct 23, 2026
Installing the module manually bypasses scripts/Makefile.modinst, so it was neither stripped and compressed nor signed with the deterministic kmodigest that the kernel uses since PR NixOS#571181, and no per-module certificate was emitted. The kmod aggregator requires a <module>.ko.cer next to every external module, breaking the module closure of hosts using it. Install through the new linuxPackages.kernelModuleInstallHook, so the kernel's `modules_install` strips, signs and compresses the module and emits the certificate. Assisted-by: Kilo Code (GLM-5.3-Flash)
B4dM4n
added a commit
to B4dM4n/nixpkgs
that referenced
this pull request
Oct 23, 2026
Installing the module manually bypasses scripts/Makefile.modinst, so it was neither stripped and compressed nor signed with the deterministic kmodigest that the kernel uses since PR NixOS#571181, and no per-module certificate was emitted. The kmod aggregator requires a <module>.ko.cer next to every external module, breaking the module closure of hosts using it. Install through the new linuxPackages.kernelModuleInstallHook, so the kernel's `modules_install` strips, signs and compresses the module and emits the certificate. Assisted-by: Kilo Code (GLM-5.3-Flash)
B4dM4n
added a commit
to B4dM4n/nixpkgs
that referenced
this pull request
Oct 23, 2026
Installing the module manually bypasses scripts/Makefile.modinst, so it was neither stripped and compressed nor signed with the deterministic kmodigest that the kernel uses since PR NixOS#571181, and no per-module certificate was emitted. The kmod aggregator requires a <module>.ko.cer next to every external module, breaking the module closure of hosts using it. Install through the new linuxPackages.kernelModuleInstallHook, so the kernel's `modules_install` strips, signs and compresses the module and emits the certificate. Assisted-by: Kilo Code (GLM-5.3-Flash)
4 of 13 tasks
4 of 13 tasks
2 of 13 tasks
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
5 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a package for kmodigest, and use it to provide optional support for deterministic module verification. Best reviewed commit‐by‐commit.
This enables the use of kernel lockdown and module signature enforcement with fully reproducible builds, bridging the gap until the Merkle tree hash‐based module integrity checking work lands upstream in Linux. The scheme used has security equivalent to conventional ECDSA with one ephemeral key per module; see the kmodigest README for much more detail.
This does not enforce module verification by default; it just enables optional support. Adding support for signing full kernel images and wiring this up into NixOS is left to future work.
The added NixOS test is moderately slow to boot, especially on x86‐64 (~20s); this is an artefact of inefficiencies in the test runner’s console handling and the verbose console log level used by default, as the kernel emits one
KERN_NOTICElog message per built‐in certificate (and hence per available kernel module). Boots with real hardware consoles and the default NixOS log level are not affected by this and the impact on boot speed there is within the milliseconds range. This only affects systems which explicitly choose to rebuild the kernel image with the module certificates anyway, so the effective user impact should be nil. I have a stack of patches to make the test runner use the virtio console which I plan to push out later.Stacked on top of #571141, #571142, and #571170.
cc @katexochen who blogged about similar keyless ECDSA tricks and might be interested in this work :)
This is part of the end‐to‐end NixOS boot security project, funded through NGI Fediversity Fund, a fund established by NLnet with financial support from the European Commission’s Next Generation Internet programme.
Things done
linux_5_10,linux,linux_latest)linux,linux_latest)kernel-module-verification,kernel-module-verification-latest)passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.