diff --git a/.gitignore b/.gitignore index 1d48086..4834a30 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,13 @@ +SOURCES/BOOTAA64.CSV +SOURCES/BOOTIA32.CSV +SOURCES/BOOTX64.CSV +SOURCES/almalinuxsecurebootca0.cer +SOURCES/fbaa64.efi +SOURCES/fbia32.efi +SOURCES/fbx64.efi +SOURCES/mmaa64.efi +SOURCES/mmia32.efi +SOURCES/mmx64.efi SOURCES/shimaa64.efi SOURCES/shimia32.efi SOURCES/shimx64.efi diff --git a/.shim.metadata b/.shim.metadata index 55b918a..29ebdec 100644 --- a/.shim.metadata +++ b/.shim.metadata @@ -1,3 +1,13 @@ -8f61bdc72cf582e2fdf094eac3bd911464857d89 SOURCES/shimaa64.efi -406c8b77a4889d8e4d27a43cc6de3e7075a69207 SOURCES/shimx64.efi +c226d7a7f41331838b973eebaac0bc01a817ba12 SOURCES/BOOTAA64.CSV +46bef68f0c2f722f4bb59385a8917c18210d4c4f SOURCES/BOOTIA32.CSV +cca8dd0b9b2e2d3a5e693087a926cb63150a0b2f SOURCES/BOOTX64.CSV +077f737b9a26b59d2517ee390879f02ab464a284 SOURCES/almalinuxsecurebootca0.cer +148b0438c52796dcc8a36dcf0a560ee42e9f6249 SOURCES/fbaa64.efi +0bbc4ac41e7ed2fb284f76995dac4be4f86f18a1 SOURCES/fbia32.efi +403a4e918a00f5e90551085c7ba545969feee26e SOURCES/fbx64.efi +f1d9c98b523ca5ad7c255f54200d9e72ee47c99f SOURCES/mmaa64.efi +8cbdaee830b36fc741e7f04228422933c07bbb4f SOURCES/mmia32.efi +08fa765dbe8902c022fe0d5b5803c14bc1e44a5c SOURCES/mmx64.efi +e3416b9372b2d0875fddcf703fc13e739c162a59 SOURCES/shimaa64.efi ca1624e26151dfd9ca730d5ef142768b3d8472f7 SOURCES/shimia32.efi +406c8b77a4889d8e4d27a43cc6de3e7075a69207 SOURCES/shimx64.efi diff --git a/SOURCES/BOOTAA64.CSV b/SOURCES/BOOTAA64.CSV deleted file mode 100644 index 3ef9ab9..0000000 Binary files a/SOURCES/BOOTAA64.CSV and /dev/null differ diff --git a/SOURCES/BOOTIA32.CSV b/SOURCES/BOOTIA32.CSV deleted file mode 100644 index a45da43..0000000 Binary files a/SOURCES/BOOTIA32.CSV and /dev/null differ diff --git a/SOURCES/BOOTX64.CSV b/SOURCES/BOOTX64.CSV deleted file mode 100644 index 38a9ef0..0000000 Binary files a/SOURCES/BOOTX64.CSV and /dev/null differ diff --git a/SOURCES/almalinuxsecurebootca0.cer b/SOURCES/almalinuxsecurebootca0.cer deleted file mode 100644 index 6a4e99b..0000000 Binary files a/SOURCES/almalinuxsecurebootca0.cer and /dev/null differ diff --git a/SOURCES/shim.rpmmacros b/SOURCES/shim.rpmmacros index 50b4f6c..8b1bbc1 100644 --- a/SOURCES/shim.rpmmacros +++ b/SOURCES/shim.rpmmacros @@ -3,6 +3,8 @@ %global vendor_token_str %{expand:%%{nil}%%{?vendor_token_name:-t "%{vendor_token_name}"}} %global vendor_cert_str %{expand:%%{!?vendor_cert_nickname:-c "Red Hat Test Certificate"}%%{?vendor_cert_nickname:-c "%%{vendor_cert_nickname}"}} +%global grub_version 2.02-87.el8_1.11 + %global bootcsvaa64 %{expand:%{SOURCE10}} %global bootcsvia32 %{expand:%{SOURCE11}} %global bootcsvx64 %{expand:%{SOURCE12}} @@ -13,10 +15,20 @@ %global shimefix64 %{expand:%{SOURCE22}} #%%global shimefiarm %%{expand:%%{SOURCE23} +%global fbefiaa64 %{expand:%{SOURCE30}} +%global fbefiia32 %{expand:%{SOURCE31}} +%global fbefix64 %{expand:%{SOURCE32}} +#%%global fbefiarm %%{expand:%%{SOURCE33} + +%global mmefiaa64 %{expand:%{SOURCE40}} +%global mmefiia32 %{expand:%{SOURCE41}} +%global mmefix64 %{expand:%{SOURCE42}} +#%%global mmefiarm %%{expand:%%{SOURCE43} + %global shimveraa64 15-7.el8_1.alma.1 %global shimveria32 15.8-2.el8.alma.1 %global shimverx64 15.8-2.el8.alma.1 -#%%global shimverarm 15-1.el8 +#%%global shimverarm 15-1.el8.alma.1 %global shimdiraa64 %{_datadir}/shim/%{shimveraa64}/aa64 %global shimdiria32 %{_datadir}/shim/%{shimveria32}/ia32 @@ -36,6 +48,10 @@ %global shimveralt %{expand:%{shimver%{?efi_alt_arch}}} %global shimdir %{expand:%{shimdir%{efi_arch}}} %global shimdiralt %{expand:%{shimdir%{?efi_alt_arch}}} +%global fbefi %{expand:%{fbefi%{efi_arch}}} +%global fbefialt %{expand:%{fbefi%{?efi_alt_arch}}} +%global mmefi %{expand:%{mmefi%{efi_arch}}} +%global mmefialt %{expand:%{mmefi%{?efi_alt_arch}}} %global unsignednone shim-unsigned-none %global unsigned %{expand:%%{unsigned%{efi_arch}}} @@ -54,6 +70,7 @@ Requires: %{efi_esp_dir}/grub%{-a*}.efi \ Requires: almalinux(grub2-sig-key) >= 202303 \ Requires: almalinux(kernel-sig-key) >= 202303 \ %endif} \ +Conflicts: grub2-efi-%{-a*} < %{grub_version} \ %{expand:%%if 0%%{-p*} \ Provides: shim = %{version}-%{release} \ Provides: shim-signed = %{version}-%{release} \ @@ -74,15 +91,17 @@ version signed by the UEFI signing service. \ # -a # -i -%define hash(a:i:d:) \ - pesign -i %{-i*} -h -P > shim.hash \ - read file0 hash0 < shim.hash \ - read file1 hash1 < %{-d*}/shim%{-a*}.hash \ - if ! [ "$hash0" = "$hash1" ]; then \ - echo Invalid signature\! > /dev/stderr \ - echo $hash0 vs $hash1 \ - exit 1 \ - fi \ +%define hash(a:i:d:) \ + if [ 0%{?_unsigned_test_build:%{_unsigned_test_build}} -ne 0 ] ; then \ + pesign -i %{-i*} -h -P > shim.hash \ + read file0 hash0 < shim.hash \ + read file1 hash1 < %{-d*}/shim%{-a*}.hash \ + if ! [ "$hash0" = "$hash1" ] ; then \ + echo Invalid signature\! > /dev/stderr \ + echo $hash0 vs $hash1 \ + exit 1 \ + fi \ + fi \ %{nil} # -i @@ -94,9 +113,25 @@ version signed by the UEFI signing service. \ # -b # -a # -i -%define distrosign(b:a:d:) \ - cp -av %{-d*}/%{-b*}%{-a*}.efi %{-b*}%{-a*}-unsigned.efi \ - %{expand:%%sign -i %{-b*}%{-a*}-unsigned.efi -o %{-b*}%{-a*}-signed.efi -n redhatsecureboot501 -a %{SOURCE2} -c %{SOURCE1} }\ +%define distrosign(b:a:d:) \ + if [ 0%{?_unsigned_test_build:%{_unsigned_test_build}} -ne 0 ] ; then \ + if [ "%{-b*}%{-a*}" = "shim%{efi_arch}" ] ; then \ + cp -av "%{shimefi}" %{-b*}%{-a*}-unsigned.efi \ + elif [ "%{-b*}%{-a*}" = "shim%{efi_alt_arch}" ] ; then \ + cp -av "%{shimefialt}" %{-b*}%{-a*}-unsigned.efi \ + elif [ "%{-b*}%{-a*}" = "mm%{efi_arch}" ] ; then \ + cp -av "%{mmefi}" %{-b*}%{-a*}-unsigned.efi \ + elif [ "%{-b*}%{-a*}" = "mm%{efi_alt_arch}" ] ; then \ + cp -av "%{mmefialt}" %{-b*}%{-a*}-unsigned.efi \ + elif [ "%{-b*}%{-a*}" = "fb%{efi_arch}" ] ; then \ + cp -av "%{fbefi}" %{-b*}%{-a*}-unsigned.efi \ + elif [ "%{-b*}%{-a*}" = "fb%{efi_alt_arch}" ] ; then \ + cp -av "%{fbefialt}" %{-b*}%{-a*}-unsigned.efi \ + fi \ + else \ + cp -av %{-d*}/%{-b*}%{-a*}.efi %{-b*}%{-a*}-unsigned.efi \ + fi \ + %{expand:%%sign -i %{-b*}%{-a*}-unsigned.efi -o %{-b*}%{-a*}-signed.efi -n redhatsecureboot501 -a %{SOURCE2} -c %{SOURCE1} } \ %{nil} # -a @@ -104,16 +139,18 @@ version signed by the UEFI signing service. \ # -b <1|0> # signed by this builder? # -c <1|0> # signed by UEFI CA? # -i +# -d /usr/share dir for this build (full path) %define define_build(a:A:b:c:i:d:) \ if [ "%{-c*}" = "yes-temporarily-disabled-20180723" ]; then \ %{expand:%%hash -i %{-i*} -a %{-a*} -d %{-d*}} \ fi \ cp %{-i*} shim%{-a*}.efi \ -if [ "%{-b*}" = "yes" ]; then \ +if [ "%{-b*}" = "yes" ] ; then \ %{expand:%%distrosign -b shim -a %{-a*} -d %{-d*}} \ mv shim%{-a*}-signed.efi shim%{-a*}-%{efi_vendor}.efi \ fi \ -if [ "%{-c*}" = "no" ]; then \ +if [ "%{-c*}" = "no" ] || \ + [ 0%{?_unsigned_test_build:%{_unsigned_test_build}} -ne 0 ] ; then \ cp shim%{-a*}-%{efi_vendor}.efi shim%{-a*}.efi \ fi \ %{expand:%%distrosign -b mm -a %{-a*} -d %{-d*}} \ @@ -148,10 +185,10 @@ install -m 0700 fb%{-a*}.efi \\\ # -A %define define_files(a:A:) \ %{expand:%%files -n shim-%{-a*}} \ -%{efi_esp_dir}/*%{-a*}*.efi \ -%{efi_esp_dir}/BOOT%{-A*}.CSV \ -%{efi_esp_boot}/*%{-a*}.efi \ -%{efi_esp_boot}/*%{-A*}.EFI \ +%%verify(not mtime) %{efi_esp_dir}/*%{-a*}*.efi \ +%%verify(not mtime) %{efi_esp_dir}/BOOT%{-A*}.CSV \ +%%verify(not mtime) %{efi_esp_boot}/*%{-a*}.efi \ +%%verify(not mtime) %{efi_esp_boot}/*%{-A*}.EFI \ %{nil} %ifarch x86_64 diff --git a/SPECS/shim.spec b/SPECS/shim.spec index d42b25d..e4267b6 100644 --- a/SPECS/shim.spec +++ b/SPECS/shim.spec @@ -4,7 +4,7 @@ Name: shim Version: 15.8 -Release: 1%{?dist}.alma.1 +Release: 4%{?dist}.alma.1 Summary: First-stage UEFI bootloader License: BSD URL: https://github.com/rhboot/shim/ @@ -24,28 +24,36 @@ Source1: almalinuxsecurebootca0.cer # match, 1 and 11 match, ... Source10: BOOTAA64.CSV Source20: shimaa64.efi +Source30: mmaa64.efi +Source40: fbaa64.efi Source11: BOOTIA32.CSV Source21: shimia32.efi +Source31: mmia32.efi +Source41: fbia32.efi Source12: BOOTX64.CSV Source22: shimx64.efi +Source32: mmx64.efi +Source42: fbx64.efi #Source13: BOOTARM.CSV #Source23: shimarm.efi +#Source33: mmarm.efi +#Source43: fbarm.efi %include %{SOURCE0} BuildRequires: pesign >= 0.112-20.fc27 -# We need this because %%{efi} won't expand before choosing where to make -# the src.rpm in koji, and we could be on a non-efi architecture, in which -# case we won't have a valid expansion here... To be solved in the future -# (shim 16+) by making the unsigned packages all provide "shim-unsigned", so -# we can just BuildRequires that. -%ifarch x86_64 -BuildRequires: %{unsignedx64} = %{shimverx64} -BuildRequires: %{unsignedia32} = %{shimveria32} -%endif -%ifarch aarch64 -BuildRequires: %{unsignedaa64} = %{shimveraa64} -%endif +# Right now we're just including all of the parts from them as sources here +# to make the build+errata process less maddening. We do this because +# %%{efi} won't expand before choosing where to make the src.rpm in koji, +# and we could be on a non-efi architecture, in which case we won't have a +# valid expansion here... +# %% ifarch x86_64 +# BuildRequires: %% {unsignedx64} = %% {shimverx64} +# BuildRequires: %% {unsignedia32} = %% {shimveria32} +# %% endif +# %% ifarch aarch64 +# BuildRequires: %% {unsignedaa64} = %% {shimveraa64} +# %% endif #%%ifarch arm #BuildRequires: %%{unsignedarm} = %%{shimverarm} #%%endif @@ -66,12 +74,14 @@ rm -rf shim-%{version} mkdir shim-%{version} %build +export PS4='${LINENO}: ' cd shim-%{version} +# Temporarily using _sourcedir to avoid build dep annoyances. %if %{efi_has_alt_arch} -%define_build -a %{efi_alt_arch} -A %{efi_alt_arch_upper} -i %{shimefialt} -b yes -c %{is_alt_signed} -d %{shimdiralt} +%define_build -a %{efi_alt_arch} -A %{efi_alt_arch_upper} -i %{shimefialt} -b yes -c %{is_alt_signed} -d %{_sourcedir} %endif -%define_build -a %{efi_arch} -A %{efi_arch_upper} -i %{shimefi} -b yes -c %{is_signed} -d %{shimdir} +%define_build -a %{efi_arch} -A %{efi_arch_upper} -i %{shimefi} -b yes -c %{is_signed} -d %{_sourcedir} %install rm -rf $RPM_BUILD_ROOT @@ -100,22 +110,43 @@ install -m 0700 %{shimefi} $RPM_BUILD_ROOT%{efi_esp_dir}/shim.efi %endif %if %{provide_legacy_shim} -%{efi_esp_dir}/shim.efi +%verify(not mtime) %{efi_esp_dir}/shim.efi %endif %changelog -* Mon Apr 01 2024 Eduard Abdullin - 15.8-1.alma.1 -- Update to shim 15.8 - -* Mon Feb 27 2023 Eduard Abdullin - 15.6-1.alma.1 -- Use AlmaLinux cert - -* Tue Aug 23 2022 Andrew Lukoshko - 15.6-1.alma +* Fri May 10 2024 Eduard Abdullin - 15.8-4.alma.1 - AlmaLinux changes -* Mon Jun 06 2022 Peter Jones - 15.6-1 -- Update to shim-15.6 - Resolves: CVE-2022-28737 +* Tue Apr 16 2024 Peter Jones - 15.8-4 +- Bump the release to *-4* to work around a build system issue. + Related: RHEL-11259 + +* Wed Apr 10 2024 Peter Jones - 15.8-3 +- Bump the release to -3 to work around a build system issue. + Related: RHEL-11259 + +* Thu Mar 28 2024 Peter Jones - 15.8-2.el8 +- Fix rpm verify issue found in testing. + Related: RHEL-11259 + +* Thu Mar 21 2024 Peter Jones - 15.8-1.el8 +- Update to shim-15.8 for CVE-2023-40547 + Resolves: RHEL-11259 + +* Wed Apr 20 2022 Peter Jones - 15.5-2.el8 +- Include the actual signed shim binaries. + Resolves: rhbz#1970632 + Resolves: rhbz#1982071 + Resolves: rhbz#2000946 + Resolves: rhbz#2002265 + +* Tue Apr 19 2022 Peter Jones - 15.5-1 +- Update to shim-15.5 + Resolves: rhbz#1970632 + Resolves: rhbz#1982071 + Resolves: rhbz#2000946 + Resolves: rhbz#2002265 +>>>>>>> c8 * Mon Sep 21 2020 Javier Martinez Canillas - 15-16 - Fix an incorrect allocation size