Repository navigation
kernel: don't trust UEFI keys for modules - #635
Merged
michaelb990 merged 1 commit intoNov 25, 2026
Merged
michaelb990 merged 1 commit into
michaelb990 merged 1 commit into
Conversation
Amazon Linux's "KEYS: Make use of platform keyring for module signature verify" patch makes the kernel retry a module's signature against the .platform keyring, which it fills from the UEFI db and, with Secure Boot on, MokListRT. On the aws-mantle variants, modules should verify only against the kit's module-signing key. Turn off CONFIG_INTEGRITY_PLATFORM_KEYRING for kernel-6.18, in the shared config so kernel-6.18-microvm follows, and for kernel-next. This also turns off LOAD_UEFI_KEYS and INTEGRITY_MACHINE_KEYRING, so the kernel creates neither .platform nor .machine and reads no keys from UEFI variables. Modules then verify only against the kernel's built-in key and keys it vouches for in the secondary keyring. Regenerate the kernel-6.18, kernel-6.18-microvm and kernel-next full configs. Signed-off-by: Michael Brown <brownxmi@amazon.com>
arnaldo2792
approved these changes
Nov 21, 2026
ginglis13
approved these changes
Nov 23, 2026
KCSesh
approved these changes
Nov 24, 2026
arnaldo2792
marked this pull request as draft
November 24, 2026 22:22
michaelb990
marked this pull request as ready for review
November 25, 2026 17:01
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.
Issue number:
N/A
Description of changes:
Amazon Linux's "KEYS: Make use of platform keyring for module signature verify" patch makes the kernel retry a
module's signature against the
.platformkeyring, which it fills from the UEFIdband, with Secure Boot on,MokListRT. On theaws-mantle-*variants, modules should verify only against the kit's module-signing key.This turns off
CONFIG_INTEGRITY_PLATFORM_KEYRINGfor kernel-6.18 and kernel-next. The kernel then creates neitherthe
.platformnor the.machinekeyring and reads no keys from UEFI variables, so modules verify only against thekernel's built-in key and keys it vouches for in the secondary keyring.
The 14 changed files:
kernel-6.18-shared-configs/config-bottlerocketis shared by kernel-6.18 andkernel-6.18-microvm;
kernel-next/config-bottlerocketis kernel-next's.config-full-bottlerocket-<target>-on-<host>files, four per kernel. Each spec diffs the resolvedconfig against them (
Source110-Source113) and fails the build on any difference. They're per build hostbecause compiler-probed options differ:
CC_HAS_MARCH_NATIVEis set only when an x86_64 host builds the x86_64kernel. The
-on-aarch64files were regenerated on an arm64 host.The four Kconfig lines that change in each full config:
INTEGRITY_PLATFORM_KEYRINGyLOAD_UEFI_KEYSyINTEGRITY_PLATFORM_KEYRINGINTEGRITY_MACHINE_KEYRINGyLOAD_UEFI_KEYSINTEGRITY_CA_MACHINE_KEYRINGSide effects:
module-signing key, and no Bottlerocket variant uses it.
with a
db, MOK or shim vendor certificate no longer verify. Nothing the kits ship is signed with those keys.dbxandMokListXRThashes are no longer added to the.blacklistkeyring.kexec_file_loadno longer verifies the Secure Boot-signedvmlinuzon grub images. Withoutlockdown it still loads; aws-dev, the only aarch64 variant on these kernels that reserves a crash kernel, has
lockdown off.
certs/system_keyring.cis built intofips140.ko, so this changes code inside the FIPS module: 3 keyringfunctions are removed and 2 change. Every algorithm and self-test function has the same instructions.
Testing done:
Built the kit for x86_64 and aarch64 and booted images with test Secure Boot keys and UEFI data that adds a test
certificate to
MokListRT, onaws-mantle-1(x86_64, aarch64),aws-mantle-1-fips(x86_64, aarch64),aws-mantle-1-nvidiaandaws-mantle-1-nvidia-fips(x86_64, on L4 and L40S),aws-mantle-next-64k-nvidia(aarch64) and
aws-ecs-4(x86_64, shim). kernel-6.18-microvm was built but not booted. A host container re-signeda module with each key and loaded it. On the
aws-mantle-*variants:dbCA, embedded in the signatureMokListRTkit certificate on each image that ran that check.
keyctlfinds neither.platformnor.machine; dmesg has noUEFI:dborUEFI:MokListRTlines.fips_enabled=1,check-fips-modulessucceeds).aws-ecs-4, a module signed by thedb-CA certificate is rejected.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.