Blame SPECS/shim-unsigned-x64.spec

2e2de3
%global pesign_vre 0.106-1
2e2de3
%global gnuefi_vre 1:3.0.5-6
2e2de3
%global openssl_vre 1.0.2j
2e2de3
2e2de3
%global debug_package %{nil}
2e2de3
%global __debug_package 1
2e2de3
%global _binaries_in_noarch_packages_terminate_build 0
2e2de3
%global __debug_install_post %{SOURCE100} x64 ia32
2e2de3
%undefine _debuginfo_subpackages
2e2de3
2e2de3
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
2e2de3
%global shimrootdir %{_datadir}/shim/
2e2de3
%global shimversiondir %{shimrootdir}/%{version}-%{release}
2e2de3
%global efiarch x64
2e2de3
%global shimdir %{shimversiondir}/%{efiarch}
2e2de3
%global efialtarch ia32
2e2de3
%global shimaltdir %{shimversiondir}/%{efialtarch}
2e2de3
2e2de3
Name:		shim-unsigned-%{efiarch}
2e2de3
Version:	15
6a35ff
Release:	9.el8
2e2de3
Summary:	First-stage UEFI bootloader
2e2de3
ExclusiveArch:	x86_64
2e2de3
License:	BSD
2e2de3
URL:		https://github.com/rhboot/shim
2e2de3
Source0:	https://github.com/rhboot/shim/releases/download/%{version}/shim-%{version}.tar.bz2
6a35ff
Source1:	redhatsecurebootca5.cer
2e2de3
# currently here's what's in our dbx:
2e2de3
# nothing.
2e2de3
Source2:	dbx.esl
2e2de3
2e2de3
Source100:	shim-find-debuginfo.sh
2e2de3
6a35ff
Patch0001: 0001-Make-some-things-dprint-instead-of-console_print.patch
6a35ff
Patch0002: 0002-Makefiles-ensure-m32-gets-propogated-to-our-gcc-para.patch
6a35ff
Patch0003: 0003-Let-MokManager-follow-a-MokTimeout-var-for-timeout-l.patch
6a35ff
Patch0004: 0004-httpboot-return-EFI_NOT_FOUND-when-it-fails-to-find-.patch
6a35ff
Patch0005: 0005-httpboot-print-more-messages-when-it-fails-to-set-IP.patch
6a35ff
Patch0006: 0006-httpboot-allow-the-IPv4-gateway-to-be-empty.patch
6a35ff
Patch0007: 0007-httpboot-show-the-error-message-for-the-ChildHandle.patch
6a35ff
Patch0008: 0008-Fix-typo-in-debug-path-in-shim.h.patch
6a35ff
Patch0009: 0009-MokManager-Stop-using-EFI_VARIABLE_APPEND_WRITE.patch
6a35ff
Patch0010: 0010-shim-Extend-invalid-reloc-size-warning-message.patch
6a35ff
Patch0011: 0011-Add-GRUB-s-PCR-Usage-to-README.tpm.patch
6a35ff
Patch0012: 0012-Fix-the-compile-error-of-mkdir-wrong-directory.patch
6a35ff
Patch0013: 0013-shim-Properly-generate-absolute-paths-from-relative-.patch
6a35ff
Patch0014: 0014-shim-Prevent-shim-to-set-itself-as-a-second-stage-lo.patch
6a35ff
Patch0015: 0015-Fix-for-Section-0-has-negative-size-error-when-loadi.patch
6a35ff
Patch0016: 0016-Fix-apparent-typo-in-ARM-32-on-64-code.patch
6a35ff
Patch0017: 0017-Makefile-do-not-run-git-on-clean-if-there-s-no-.git-.patch
6a35ff
Patch0018: 0018-Make.default-use-correct-flags-to-disable-unaligned-.patch
6a35ff
Patch0019: 0019-Cryptlib-fix-build-on-32bit-ARM.patch
6a35ff
Patch0020: 0020-Make-sure-that-MOK-variables-always-get-mirrored.patch
6a35ff
Patch0021: 0021-mok-fix-the-mirroring-of-RT-variables.patch
6a35ff
Patch0022: 0022-mok-consolidate-mirroring-code-in-a-helper-instead-o.patch
6a35ff
Patch0023: 0023-shim-only-include-shim_cert.h-in-shim.c.patch
6a35ff
Patch0024: 0024-mok-also-mirror-the-build-cert-to-MokListRT.patch
6a35ff
Patch0025: 0025-mok-minor-cleanups.patch
6a35ff
Patch0026: 0026-Remove-call-to-TPM2-get_event_log.patch
6a35ff
Patch0027: 0027-Make-EFI-variable-copying-fatal-only-on-secureboot-e.patch
6a35ff
Patch0028: 0028-VLogError-Avoid-NULL-pointer-dereferences-in-V-Sprin.patch
6a35ff
Patch0029: 0029-Once-again-try-even-harder-to-get-binaries-without-t.patch
6a35ff
Patch0030: 0030-shim-Rework-pause-functions-and-add-read_counter.patch
6a35ff
Patch0031: 0031-Hook-exit-when-shim_lock-protocol-installed.patch
6a35ff
Patch0032: 0032-Work-around-stuff-Waddress-of-packed-member-finds.patch
6a35ff
Patch0033: 0033-Fix-a-use-of-strlen-instead-of-Strlen.patch
6a35ff
Patch0034: 0034-MokManager-Use-CompareMem-on-MokListNode.Type-instea.patch
6a35ff
Patch0035: 0035-OpenSSL-always-provide-OBJ_create-with-name-strings.patch
6a35ff
Patch0036: 0036-Use-portable-shebangs-bin-bash-usr-bin-env-bash.patch
6a35ff
Patch0037: 0037-tpm-Fix-off-by-one-error-when-calculating-event-size.patch
6a35ff
Patch0038: 0038-tpm-Define-EFI_VARIABLE_DATA_TREE-as-packed.patch
6a35ff
Patch0039: 0039-MokManager-console-mode-modification-for-hi-dpi-scre.patch
6a35ff
Patch0040: 0040-MokManager-avoid-Werror-address-of-packed-member.patch
6a35ff
Patch0041: 0041-tpm-Don-t-log-duplicate-identical-events.patch
6a35ff
Patch0042: 0042-Slightly-better-debugging-messages.patch
6a35ff
Patch0043: 0043-Actually-check-for-errors-from-set_second_stage.patch
6a35ff
Patch0044: 0044-translate_slashes-don-t-write-to-string-literals.patch
6a35ff
Patch0045: 0045-shim-Update-EFI_LOADED_IMAGE-with-the-second-stage-l.patch
6a35ff
Patch0046: 0046-tpm-Include-information-about-PE-COFF-images-in-the-.patch
6a35ff
Patch0047: 0047-Fix-the-license-on-our-buildid-extractor.patch
6a35ff
Patch0048: 0048-Update-README.tpm.patch
6a35ff
Patch0049: 0049-Check-PxeReplyReceived-as-fallback-in-netboot.patch
6a35ff
Patch0050: 0050-Remove-a-couple-of-incorrect-license-claims.patch
6a35ff
Patch0051: 0051-MokManager-fix-uninitialized-value.patch
6a35ff
Patch0052: 0052-Fix-some-volatile-usage-gcc-whines-about.patch
6a35ff
Patch0053: 0053-MokManager-fix-a-wrong-allocation-failure-check.patch
6a35ff
Patch0054: 0054-simple_file-fix-uninitialized-variable-unchecked-ret.patch
6a35ff
Patch0055: 0055-Fix-a-broken-tpm-type.patch
6a35ff
Patch0056: 0056-Make-cert.S-not-impossible-to-read.patch
6a35ff
Patch0057: 0057-Add-support-for-vendor_db-built-in-shim-authorized-l.patch
6a35ff
Patch0058: 0058-Handle-binaries-with-multiple-signatures.patch
6a35ff
Patch0059: 0059-Make-openssl-accept-the-right-set-of-KU-EKUs.patch
6a35ff
Patch0060: 0060-Improve-debug-output-some.patch
6a35ff
Patch0061: 0061-Also-use-a-config-table-to-mirror-mok-variables.patch
6a35ff
Patch0062: 0062-Implement-lennysz-s-suggestions-for-MokListRT.patch
6a35ff
Patch0063: 0063-hexdump.h-fix-arithmetic-error.patch
6a35ff
Patch0064: 0064-Fix-some-mokmanager-deletion-paths.patch
6a35ff
Patch0065: 0065-Fix-buffer-overrun-due-DEFAULT_LOADER-length-miscalc.patch
12f6e9
2e2de3
BuildRequires:	elfutils-libelf-devel
2e2de3
BuildRequires:	git openssl-devel openssl
2e2de3
BuildRequires:	pesign >= %{pesign_vre}
2e2de3
BuildRequires:	gnu-efi >= %{gnuefi_vre}
2e2de3
BuildRequires:	gnu-efi-devel >= %{gnuefi_vre}
2e2de3
2e2de3
# Shim uses OpenSSL, but cannot use the system copy as the UEFI ABI is not
2e2de3
# compatible with SysV (there's no red zone under UEFI) and there isn't a
2e2de3
# POSIX-style C library.
2e2de3
# BuildRequires:	OpenSSL
2e2de3
Provides:	bundled(openssl) = %{openssl_vre}
2e2de3
2e2de3
%global desc \
2e2de3
Initial UEFI bootloader that handles chaining to a trusted full \
2e2de3
bootloader under secure boot environments.
2e2de3
%global debug_desc \
2e2de3
This package provides debug information for package %{expand:%%{name}} \
2e2de3
Debug information is useful when developing applications that \
2e2de3
use this package or when debugging this package.
2e2de3
2e2de3
%description
2e2de3
%desc
2e2de3
2e2de3
%package -n shim-unsigned-%{efialtarch}
2e2de3
Summary:	First-stage UEFI bootloader (unsigned data)
2e2de3
Provides:	bundled(openssl) = %{openssl_vre}
2e2de3
2e2de3
%description -n shim-unsigned-%{efialtarch}
2e2de3
%desc
2e2de3
2e2de3
%package debuginfo
2e2de3
Summary:	Debug information for shim-unsigned-%{efiarch}
2e2de3
Requires:	%{name}-debugsource = %{version}-%{release}
2e2de3
Group:		Development/Debug
2e2de3
AutoReqProv:	0
2e2de3
BuildArch:	noarch
2e2de3
2e2de3
%description debuginfo
2e2de3
%debug_desc
2e2de3
2e2de3
%package -n shim-unsigned-%{efialtarch}-debuginfo
2e2de3
Summary:	Debug information for shim-unsigned-%{efialtarch}
2e2de3
Group:		Development/Debug
2e2de3
Requires:	%{name}-debugsource = %{version}-%{release}
2e2de3
AutoReqProv:	0
2e2de3
BuildArch:	noarch
2e2de3
2e2de3
%description -n shim-unsigned-%{efialtarch}-debuginfo
2e2de3
%debug_desc
2e2de3
2e2de3
%package debugsource
2e2de3
Summary:	Debug Source for shim-unsigned
2e2de3
Group:		Development/Debug
2e2de3
AutoReqProv:	0
2e2de3
BuildArch:	noarch
2e2de3
2e2de3
%description debugsource
2e2de3
%debug_desc
2e2de3
2e2de3
%prep
2e2de3
%autosetup -S git -n shim-%{version}
2e2de3
git config --unset user.email
2e2de3
git config --unset user.name
2e2de3
mkdir build-%{efiarch}
2e2de3
mkdir build-%{efialtarch}
2e2de3
2e2de3
%build
2e2de3
COMMITID=$(cat commit)
2e2de3
MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} "
2e2de3
MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} "
2e2de3
MAKEFLAGS+="ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true "
2e2de3
MAKEFLAGS+="%{_smp_mflags}"
6a35ff
if [ -s "%{SOURCE1}" ]; then
2e2de3
	MAKEFLAGS="$MAKEFLAGS VENDOR_CERT_FILE=%{SOURCE1}"
2e2de3
fi
6a35ff
if [ -s "%{SOURCE2}" ]; then
2e2de3
	MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
2e2de3
fi
2e2de3
2e2de3
cd build-%{efiarch}
2e2de3
make ${MAKEFLAGS} DEFAULT_LOADER='\\\\grub%{efiarch}.efi' all
2e2de3
cd ..
2e2de3
2e2de3
cd build-%{efialtarch}
2e2de3
setarch linux32 -B make ${MAKEFLAGS} ARCH=%{efialtarch} DEFAULT_LOADER='\\\\grub%{efialtarch}.efi' all
2e2de3
cd ..
2e2de3
2e2de3
%install
2e2de3
COMMITID=$(cat commit)
2e2de3
MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} "
2e2de3
MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} "
2e2de3
MAKEFLAGS+="ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true "
6a35ff
if [ -s "%{SOURCE1}" ]; then
2e2de3
	MAKEFLAGS="$MAKEFLAGS VENDOR_CERT_FILE=%{SOURCE1}"
2e2de3
fi
6a35ff
if [ -s "%{SOURCE2}" ]; then
2e2de3
	MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
2e2de3
fi
2e2de3
2e2de3
cd build-%{efiarch}
2e2de3
make ${MAKEFLAGS} \
2e2de3
	DEFAULT_LOADER='\\\\grub%{efiarch}.efi' \
2e2de3
	DESTDIR=${RPM_BUILD_ROOT} \
2e2de3
	install-as-data install-debuginfo install-debugsource
2e2de3
cd ..
2e2de3
2e2de3
cd build-%{efialtarch}
2e2de3
setarch linux32 make ${MAKEFLAGS} ARCH=%{efialtarch} \
2e2de3
	DEFAULT_LOADER='\\\\grub%{efialtarch}.efi' \
2e2de3
	DESTDIR=${RPM_BUILD_ROOT} \
2e2de3
	install-as-data install-debuginfo install-debugsource
2e2de3
cd ..
2e2de3
2e2de3
%files
2e2de3
%license COPYRIGHT
2e2de3
%dir %{shimrootdir}
2e2de3
%dir %{shimversiondir}
2e2de3
%dir %{shimdir}
2e2de3
%{shimdir}/*.efi
2e2de3
%{shimdir}/*.hash
2e2de3
2e2de3
%files -n shim-unsigned-%{efialtarch}
2e2de3
%license COPYRIGHT
2e2de3
%dir %{shimrootdir}
2e2de3
%dir %{shimversiondir}
2e2de3
%dir %{shimaltdir}
2e2de3
%{shimaltdir}/*.efi
2e2de3
%{shimaltdir}/*.hash
2e2de3
2e2de3
%files debuginfo -f build-%{efiarch}/debugfiles.list
2e2de3
2e2de3
%files -n shim-unsigned-%{efialtarch}-debuginfo -f build-%{efialtarch}/debugfiles.list
2e2de3
2e2de3
%files debugsource -f build-%{efiarch}/debugsource.list
2e2de3
2e2de3
%changelog
6a35ff
* Thu Sep 17 2020 Peter Jones <pjones@redhat.com> - 15-9.el8
6a35ff
- Fix an incorrect allocation size.
6a35ff
  Related: rhbz#1877253
6a35ff
6a35ff
* Thu Jul 30 2020 Peter Jones <pjones@redhat.com> - 15-8
6a35ff
- Fix a load-address-dependent forever loop.
6a35ff
  Resolves: rhbz#1861977
6a35ff
  Related: CVE-2020-10713
6a35ff
  Related: CVE-2020-14308
6a35ff
  Related: CVE-2020-14309
6a35ff
  Related: CVE-2020-14310
6a35ff
  Related: CVE-2020-14311
6a35ff
  Related: CVE-2020-15705
6a35ff
  Related: CVE-2020-15706
6a35ff
  Related: CVE-2020-15707
6a35ff
6a35ff
* Sat Jul 25 2020 Peter Jones <pjones@redhat.com> - 15-7
6a35ff
- Implement Lenny's workaround
6a35ff
  Related: CVE-2020-10713
6a35ff
  Related: CVE-2020-14308
6a35ff
  Related: CVE-2020-14309
6a35ff
  Related: CVE-2020-14310
6a35ff
  Related: CVE-2020-14311
6a35ff
6a35ff
* Fri Jul 24 2020 Peter Jones <pjones@redhat.com> - 15-5
6a35ff
- Once more with the MokListRT config table patch added.
6a35ff
  Related: CVE-2020-10713
6a35ff
  Related: CVE-2020-14308
6a35ff
  Related: CVE-2020-14309
6a35ff
  Related: CVE-2020-14310
6a35ff
  Related: CVE-2020-14311
6a35ff
6a35ff
* Thu Jul 23 2020 Peter Jones <pjones@redhat.com> - 15-4
6a35ff
- Rebuild for bug fixes and new signing keys
6a35ff
  Related: CVE-2020-10713
6a35ff
  Related: CVE-2020-14308
6a35ff
  Related: CVE-2020-14309
6a35ff
  Related: CVE-2020-14310
6a35ff
  Related: CVE-2020-14311
6a35ff
6a35ff
* Wed Jun 05 2019 Javier Martinez Canillas <javierm@redhat.com> - 15-3
6a35ff
- Make EFI variable copying fatal only on secureboot enabled systems
6a35ff
  Resolves: rhbz#1715878
6a35ff
- Fix booting shim from an EFI shell using a relative path
6a35ff
  Resolves: rhbz#1717064
6a35ff
12f6e9
* Tue Feb 12 2019 Peter Jones <pjones@redhat.com> - 15-2
12f6e9
- Fix MoK mirroring issue which breaks kdump without intervention
12f6e9
  Related: rhbz#1668966
12f6e9
2e2de3
* Fri Jul 20 2018 Peter Jones <pjones@redhat.com> - 15-1
2e2de3
- Update to shim 15
2e2de3
2e2de3
* Tue Sep 19 2017 Peter Jones <pjones@redhat.com> - 13-3
2e2de3
- Actually update to the *real* 13 final.
2e2de3
  Related: rhbz#1489604
2e2de3
2e2de3
* Thu Aug 31 2017 Peter Jones <pjones@redhat.com> - 13-2
2e2de3
- Actually update to 13 final.
2e2de3
2e2de3
* Fri Aug 18 2017 Peter Jones <pjones@redhat.com> - 13-1
2e2de3
- Make a new shim-unsigned-x64 package like the shim-unsigned-aarch64 one.
2e2de3
- This will (eventually) supersede what's in the "shim" package so we can
2e2de3
  make "shim" hold the signed one, which will confuse fewer people.