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

Enable signature verification of kexec kernel and use new Mariner Trusted Base CA in trusted keyring #10961

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion SPECS-SIGNED/kernel-signed/kernel-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Summary: Signed Linux Kernel for %{buildarch} systems
Name: kernel-signed-%{buildarch}
Version: 6.6.57.1
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -145,6 +145,9 @@ echo "initrd of kernel %{uname_r} removed" >&2
%exclude /module_info.ld

%changelog
* Tue Nov 05 2024 Chris Co <[email protected]> - 6.6.57.1-3
- Bump release to match kernel

* Wed Oct 30 2024 Thien Trung Vuong <[email protected]> - 6.6.57.1-2
- Bump release to match kernel

Expand Down
5 changes: 4 additions & 1 deletion SPECS-SIGNED/kernel-uki-signed/kernel-uki-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Summary: Signed Unified Kernel Image for %{buildarch} systems
Name: kernel-uki-signed-%{buildarch}
Version: 6.6.57.1
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -68,6 +68,9 @@ popd
/boot/efi/EFI/Linux/vmlinuz-uki-%{kernelver}.efi

%changelog
* Tue Nov 05 2024 Chris Co <[email protected]> - 6.6.57.1-3
- Bump release to match kernel

* Wed Oct 30 2024 Thien Trung Vuong <[email protected]> - 6.6.57.1-2
- Bump release to match kernel

Expand Down
5 changes: 4 additions & 1 deletion SPECS/kernel-headers/kernel-headers.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Summary: Linux API header files
Name: kernel-headers
Version: 6.6.57.1
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -75,6 +75,9 @@ done
%endif

%changelog
* Tue Nov 05 2024 Chris Co <[email protected]> - 6.6.57.1-3
- Bump release to match kernel

* Wed Oct 30 2024 Thien Trung Vuong <[email protected]> - 6.6.57.1-2
- Bump release to match kernel

Expand Down
38 changes: 38 additions & 0 deletions SPECS/kernel/azurelinux-ca-20230216.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-----BEGIN CERTIFICATE-----
MIIGtjCCBJ6gAwIBAgITMwAAAAJjlHB6Ftnx2gAAAAAAAjANBgkqhkiG9w0BAQ0F
ADBaMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
MSswKQYDVQQDEyJNaWNyb3NvZnQgTWFyaW5lciBSU0EgUm9vdCBDQSAyMDIzMB4X
DTIzMDIxNjE5MzkwMloXDTM4MDIwOTIxMjU1M1owYDELMAkGA1UEBhMCVVMxHjAc
BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjExMC8GA1UEAxMoTWFyaW5lciBU
cnVzdGVkIEJhc2UgUlNBIENvZGUgU2lnbmluZyBDQTCCAiIwDQYJKoZIhvcNAQEB
BQADggIPADCCAgoCggIBAL+8TFnwSX6pE1J6Eb4fdVJy0pLmFrY1G8oqxfPqY0l0
rezoei1p8hZrPAsk1l/lp+BIDrYl/0TiZOSkVBMod569/JDntohvjycZtCKK+9PY
MophsyD5XvsK7xNaRixxTTOLJ561iKQqny29bJNgO/N909s9pXFa1chQKWm3Ib8I
SiZwj0CixWTwfGmTqa9pR1mwQydUK8HS4uO5i2WqB065b1R48rEGmC0m4WYX37Od
E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OFTvI+4Dd33kltMCy2/lwf1Ci8XIlYAH/e
IiO4lKqIk2Dbfn2eMCMeFFx0BQ0zvxHJYUMWz/kqdTxR57LZclBUGPn+Q/2pDZYf
uXGsS1rQqFBV6yxSgDLAAO9AuBvz32rwlGyichrufHEM1+YfjP8w6wpi0u/JHTeq
A6zFshkXxXQYL7R8IjlCUVWIG9vBA0YgdcaYXY5MT1WctMcWCCu12gWtU3fOC86X
rf+A++UtCYXAL1h4g0YOpZIL6LRh7CiR5Kh7cw9ylYv93+YESQHY2VAwCs+j/xRe
xkv5oWRGkzAqESSv0iJfZg7DzvyE+9XbIYKGoS2NrPyGCStZsXl7B3QpA4dAvj0o
ye5YZXbFtIgHS4uGyUYvEYYedNC4/ujZ7tcBvxKB3BzKJry7MkLtUJhfqQnVDFkY
8wpy24yem9IDR0n2Ua1a9/kbmxDT+lJ4q7fMxPJf2QnTkdQXSuNejz6N4yUqiX22
2HLmkDFdheq2hMY0oi5PkivsnYn7b4sDclyuen04BFBIwfy0RwRSWEfzwTfdrGT6
V/XT/3n9twDIFZyK8oRjUlwo0GAiq8r0uwPOKnLQPpKJpWC4ICs1LjkB
-----END CERTIFICATE-----
29 changes: 0 additions & 29 deletions SPECS/kernel/cbl-mariner-ca-20211013.pem

This file was deleted.

6 changes: 4 additions & 2 deletions SPECS/kernel/config
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ CONFIG_KEXEC_CORE=y
CONFIG_HAVE_IMA_KEXEC=y
# CONFIG_KEXEC is not set
CONFIG_KEXEC_FILE=y
# CONFIG_KEXEC_SIG is not set
CONFIG_KEXEC_SIG=y
Copy link
Contributor

Choose a reason for hiding this comment

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

# CONFIG_KEXEC_SIG_FORCE is not set
Copy link
Contributor

@rlmenge rlmenge Nov 21, 2024

Choose a reason for hiding this comment

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

Kconfig

Only available on x86: https://github.com/microsoft/CBL-Mariner-Linux-Kernel/blob/rolling-lts/mariner-3/6.6.57.1/arch/x86/Kconfig#L2038
Requires that signatures ALWAYS be checked. KEXEC_SIG only checks when a signature is present

(Note not supported on arm64: https://github.com/microsoft/CBL-Mariner-Linux-Kernel/blob/rolling-lts/mariner-3/6.6.57.1/arch/arm64/Kconfig)

Copy link
Contributor

Choose a reason for hiding this comment

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

Clarification: for this PR we are simply enabling kexec signature validation as an option and not forcing for now

CONFIG_KEXEC_BZIMAGE_VERIFY_SIG=y
Copy link
Contributor

Choose a reason for hiding this comment

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

CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192
Expand Down Expand Up @@ -7697,7 +7699,7 @@ CONFIG_X509_CERTIFICATE_PARSER=y
# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set
CONFIG_PKCS7_MESSAGE_PARSER=y
# CONFIG_PKCS7_TEST_KEY is not set
# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
Copy link
Contributor

Choose a reason for hiding this comment

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

# CONFIG_FIPS_SIGNATURE_SELFTEST is not set

#
Expand Down
5 changes: 3 additions & 2 deletions SPECS/kernel/config_aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ CONFIG_KEXEC_CORE=y
CONFIG_HAVE_IMA_KEXEC=y
# CONFIG_KEXEC is not set
CONFIG_KEXEC_FILE=y
# CONFIG_KEXEC_SIG is not set
CONFIG_KEXEC_SIG=y
CONFIG_KEXEC_IMAGE_VERIFY_SIG=y
CONFIG_CRASH_DUMP=y
# end of Kexec and crash features
# end of General setup
Expand Down Expand Up @@ -10791,7 +10792,7 @@ CONFIG_X509_CERTIFICATE_PARSER=y
# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set
CONFIG_PKCS7_MESSAGE_PARSER=y
# CONFIG_PKCS7_TEST_KEY is not set
# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set
CONFIG_SIGNED_PE_FILE_VERIFICATION=y
# CONFIG_FIPS_SIGNATURE_SELFTEST is not set

#
Expand Down
5 changes: 4 additions & 1 deletion SPECS/kernel/kernel-uki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Summary: Unified Kernel Image
Name: kernel-uki
Version: 6.6.57.1
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand Down Expand Up @@ -70,6 +70,9 @@ cp %{buildroot}/boot/vmlinuz-uki-%{kernelver}.efi %{buildroot}/boot/efi/EFI/Linu
/boot/efi/EFI/Linux/vmlinuz-uki-%{kernelver}.efi

%changelog
* Tue Nov 05 2024 Chris Co <[email protected]> - 6.6.57.1-3
- Bump release to match kernel

* Wed Oct 30 2024 Thien Trung Vuong <[email protected]> - 6.6.57.1-2
- Remove noxsaves parameter from cmdline

Expand Down
6 changes: 3 additions & 3 deletions SPECS/kernel/kernel.signatures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Signatures": {
"cbl-mariner-ca-20211013.pem": "5ef124b0924cb1047c111a0ecff1ae11e6ad7cac8d1d9b40f98f99334121f0b0",
"config": "5636a263f1802641e806b6971303eb28f77167ef42ece09782b4638c75bf03b5",
"config_aarch64": "bac4a99b57ce11f25ef8bce844ed6285932aa29139b85ccde850acaabafdcffd",
"azurelinux-ca-20230216.pem": "d545401163c75878319f01470455e6bc18a5968e39dd964323225e3fe308849b",
"config": "00c9071da520dd42e8465fd8d9f36945a4f6127798c16a45f5200cfd7256ed1e",
"config_aarch64": "e0d92980c9388de35b7dde65a385865ef3207f4c50b0e9988f90394e8d627c77",
"cpupower": "d7518767bf2b1110d146a49c7d42e76b803f45eb8bd14d931aa6d0d346fae985",
"cpupower.service": "b057fe9e5d0e8c36f485818286b80e3eba8ff66ff44797940e99b1fd5361bb98",
"sha512hmac-openssl.sh": "02ab91329c4be09ee66d759e4d23ac875037c3b56e5a598e32fd1206da06a27f",
Expand Down
8 changes: 6 additions & 2 deletions SPECS/kernel/kernel.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Summary: Linux Kernel
Name: kernel
Version: 6.6.57.1
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand All @@ -40,7 +40,7 @@ Source0: https://github.com/microsoft/CBL-Mariner-Linux-Kernel/archive/ro
Source1: config
Source2: config_aarch64
Source3: sha512hmac-openssl.sh
Source4: cbl-mariner-ca-20211013.pem
Source4: azurelinux-ca-20230216.pem
Source5: cpupower
Source6: cpupower.service
Patch0: 0001-add-mstflint-kernel-%{mstflintver}.patch
Expand Down Expand Up @@ -407,6 +407,10 @@ echo "initrd of kernel %{uname_r} removed" >&2
%{_sysconfdir}/bash_completion.d/bpftool

%changelog
* Tue Nov 05 2024 Chris Co <[email protected]> - 6.6.57.1-3
- Enable kexec signature verification
- Introduce new azurelinux-ca-20230216.pem

* Wed Oct 30 2024 Thien Trung Vuong <[email protected]> - 6.6.57.1-2
- UKI: remove noxsaves parameter from cmdline

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
filesystem-1.1-21.azl3.aarch64.rpm
kernel-headers-6.6.57.1-2.azl3.noarch.rpm
kernel-headers-6.6.57.1-3.azl3.noarch.rpm
glibc-2.38-8.azl3.aarch64.rpm
glibc-devel-2.38-8.azl3.aarch64.rpm
glibc-i18n-2.38-8.azl3.aarch64.rpm
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
filesystem-1.1-21.azl3.x86_64.rpm
kernel-headers-6.6.57.1-2.azl3.noarch.rpm
kernel-headers-6.6.57.1-3.azl3.noarch.rpm
glibc-2.38-8.azl3.x86_64.rpm
glibc-devel-2.38-8.azl3.x86_64.rpm
glibc-i18n-2.38-8.azl3.x86_64.rpm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ intltool-0.51.0-7.azl3.noarch.rpm
itstool-2.0.7-1.azl3.noarch.rpm
kbd-2.2.0-2.azl3.aarch64.rpm
kbd-debuginfo-2.2.0-2.azl3.aarch64.rpm
kernel-headers-6.6.57.1-2.azl3.noarch.rpm
kernel-headers-6.6.57.1-3.azl3.noarch.rpm
kmod-30-1.azl3.aarch64.rpm
kmod-debuginfo-30-1.azl3.aarch64.rpm
kmod-devel-30-1.azl3.aarch64.rpm
Expand Down
4 changes: 2 additions & 2 deletions toolkit/resources/manifests/package/toolchain_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ intltool-0.51.0-7.azl3.noarch.rpm
itstool-2.0.7-1.azl3.noarch.rpm
kbd-2.2.0-2.azl3.x86_64.rpm
kbd-debuginfo-2.2.0-2.azl3.x86_64.rpm
kernel-cross-headers-6.6.57.1-2.azl3.noarch.rpm
kernel-headers-6.6.57.1-2.azl3.noarch.rpm
kernel-cross-headers-6.6.57.1-3.azl3.noarch.rpm
kernel-headers-6.6.57.1-3.azl3.noarch.rpm
kmod-30-1.azl3.x86_64.rpm
kmod-debuginfo-30-1.azl3.x86_64.rpm
kmod-devel-30-1.azl3.x86_64.rpm
Expand Down
Loading