Blame SPECS/shim-unsigned-x64.spec

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