Blame SPECS/kpatch-patch.spec

749425
# Set to 1 if building an empty subscription-only package.
14468b
%define empty_package		0
749425
749425
#######################################################
749425
# Only need to update these variables and the changelog
749425
%define kernel_ver	3.10.0-1160.6.1.el7
749425
%define kpatch_ver	0.9.2
14468b
%define rpm_ver		1
042b09
%define rpm_rel		10
749425
749425
%if !%{empty_package}
749425
# Patch sources below. DO NOT REMOVE THIS LINE.
14468b
#
14468b
# https://bugzilla.redhat.com/1881413
14468b
Source100: fs-xfs-fix-boundary-test-in-xfs_attr_shortform_verify.patch
f07e16
#
f07e16
# https://bugzilla.redhat.com/1908206
f07e16
Source101: tty-Fix-pgrp-locking-in-tiocspgrp.patch
f07e16
#
f07e16
# https://bugzilla.redhat.com/1902568
f07e16
Source102: target-scsi-Fix-XCOPY-NAA-identifier-lookup.patch
a56882
#
a56882
# https://bugzilla.redhat.com/1930840
a56882
# https://bugzilla.redhat.com/1930863
a56882
Source103: scsi-iscsi-kpatch-fixes-for-CVE-2021-27364-and-CVE-2.patch
738669
#
738669
# https://bugzilla.redhat.com/1935112
738669
Source104: CVE-2021-3347.patch
2b8560
#
2b8560
# https://bugzilla.redhat.com/1962518
2b8560
Source105: CVE-2021-33034.patch
2b8560
#
2b8560
# https://bugzilla.redhat.com/1975256
2b8560
Source106: CVE-2021-33909.patch
ad1123
#
ad1123
# https://bugzilla.redhat.com/1971474
ad1123
Source107: CVE-2021-32399.patch
ad1123
#
ad1123
# https://bugzilla.redhat.com/1980516
ad1123
Source108: CVE-2021-22555.patch
feeec8
#
feeec8
# https://bugzilla.redhat.com/1997195
feeec8
Source109: CVE-2021-3715.patch
042b09
#
042b09
# https://bugzilla.redhat.com/1975766
042b09
Source110: CVE-2021-22543.patch
042b09
#
042b09
# https://bugzilla.redhat.com/1988221
042b09
Source111: CVE-2021-37576.patch
749425
# End of patch sources. DO NOT REMOVE THIS LINE.
749425
%endif
749425
749425
%define sanitized_rpm_rel	%{lua: print((string.gsub(rpm.expand("%rpm_rel"), "%.", "_")))}
749425
%define sanitized_kernel_ver	%{lua: print((string.gsub(string.gsub(rpm.expand("%kernel_ver"), ".el7", ""), "%.", "_")))}
749425
%define kernel_ver_arch	%{kernel_ver}.%{_arch}
749425
749425
Name:		kpatch-patch-%{sanitized_kernel_ver}
749425
Version:	%{rpm_ver}
749425
Release:	%{rpm_rel}.el7
749425
749425
%if %{empty_package}
749425
Summary:	Initial empty kpatch-patch for kernel-%{kernel_ver_arch}
749425
%else
749425
Summary:	Live kernel patching module for kernel-%{kernel_ver_arch}
749425
%endif
749425
749425
Group:		System Environment/Kernel
749425
License:	GPLv2
749425
ExclusiveArch:	x86_64 ppc64le
749425
749425
Conflicts:	%{name} < %{version}-%{release}
749425
749425
Provides:	kpatch-patch = %{kernel_ver_arch}
749425
Provides:	kpatch-patch = %{kernel_ver}
749425
749425
%if !%{empty_package}
749425
Requires:	systemd
749425
%endif
749425
Requires:	kpatch >= 0.4.0-3
749425
Requires:	kernel-uname-r = %{kernel_ver_arch}
749425
749425
%if !%{empty_package}
749425
BuildRequires:	gcc elfutils-devel rpmdevtools asciidoc bc hmaccalc m4 net-tools xmlto zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison audit-libs-devel numactl-devel pciutils-devel openssl gettext kernel-devel ncurses-devel hostname java-devel python-docutils
749425
BuildRequires:	kernel-devel = %{kernel_ver}
749425
BuildRequires:	kernel-debuginfo = %{kernel_ver}
749425
749425
%ifarch x86_64
749425
BuildRequires: pesign
749425
%endif
749425
749425
%ifarch ppc64le
749425
BuildRequires: gcc-plugin-devel
749425
%endif
749425
749425
Source0:	https://github.com/dynup/kpatch/archive/v%{kpatch_ver}.tar.gz
749425
749425
Source10:	kernel-%{kernel_ver}.src.rpm
749425
749425
# kpatch-build patches
749425
# Patch1: backport.patch
749425
749425
%global _dupsign_opts --keyname=rhelkpatch1
749425
749425
%define builddir	%{_builddir}/kpatch-%{kpatch_ver}
749425
%define kpatch		%{_sbindir}/kpatch
749425
%define kmoddir		%{_usr}/lib/kpatch/%{kernel_ver_arch}
749425
%define patchmodname	kpatch-%{sanitized_kernel_ver}-%{version}-%{sanitized_rpm_rel}
749425
%define patchmod	%{patchmodname}.ko
749425
749425
%define _missing_build_ids_terminate_build 1
749425
%define _find_debuginfo_opts -r
749425
%undefine _include_minidebuginfo
749425
%undefine _find_debuginfo_dwz_opts
749425
749425
%description
749425
This is a kernel live patch module which can be loaded by the kpatch
749425
command line utility to modify the code of a running kernel.  This patch
749425
module is targeted for kernel-%{kernel_ver}.
749425
749425
%prep
749425
%autosetup -n kpatch-%{kpatch_ver} -p1
749425
749425
%build
749425
kdevdir=/usr/src/kernels/%{kernel_ver_arch}
749425
vmlinux=/usr/lib/debug/lib/modules/%{kernel_ver_arch}/vmlinux
749425
749425
# kpatch-build
749425
make -C kpatch-build
749425
749425
# patch module
749425
for i in %{sources}; do
749425
	[[ $i == *.patch ]] && patch_sources="$patch_sources $i"
749425
done
749425
export CACHEDIR="%{builddir}/.kpatch"
749425
kpatch-build/kpatch-build -n %{patchmodname} -r %{SOURCE10} -v $vmlinux --skip-cleanup $patch_sources || { cat "${CACHEDIR}/build.log"; exit 1; }
749425
749425
749425
%install
749425
installdir=%{buildroot}/%{kmoddir}
749425
install -d $installdir
749425
install -m 755 %{builddir}/%{patchmod} $installdir
749425
749425
749425
%files
749425
%{_usr}/lib/kpatch
749425
749425
749425
%post
749425
if [[ %{kernel_ver_arch} = $(uname -r) ]]; then
749425
	cver="%{rpm_ver}_%{rpm_rel}"
749425
	pname=$(echo "kpatch_%{sanitized_kernel_ver}" | sed 's/-/_/')
749425
749425
	lver=$({ %{kpatch} list | sed -nr "s/^${pname}_([0-9_]+)\ \[enabled\]$/\1/p"; echo "${cver}"; } | sort -V | tail -1)
749425
749425
	if [ "${lver}" != "${cver}" ]; then
749425
		echo "WARNING: at least one loaded kpatch-patch (${pname}_${lver}) has a newer version than the one being installed."
749425
		echo "WARNING: You will have to reboot to load a downgraded kpatch-patch"
749425
	else
749425
		%{kpatch} load %{kmoddir}/%{patchmod}
749425
	fi
749425
fi
749425
%{kpatch} install -k %{kernel_ver_arch} %{kmoddir}/%{patchmod}
749425
sync
749425
exit 0
749425
749425
749425
%postun
749425
%{kpatch} uninstall -k %{kernel_ver_arch} %{patchmod}
749425
sync
749425
exit 0
749425
749425
%else
749425
%description
749425
This is an empty kpatch-patch package which does not contain any real patches.
749425
It is only a method to subscribe to the kpatch stream for kernel-%{kernel_ver}.
749425
749425
%files
749425
%doc
749425
%endif
749425
749425
%changelog
042b09
* Wed Sep 29 2021 Joe Lawrence <joe.lawrence@redhat.com> [1-10.el7]
042b09
- kernel: powerpc: KVM guest OS users can cause host OS memory corruption [1988221] {CVE-2021-37576}
042b09
- kernel: Improper handling of VM_IO|VM_PFNMAP vmas in KVM can bypass RO checks [1975766] {CVE-2021-22543}
042b09
feeec8
* Tue Aug 31 2021 Joe Lawrence <joe.lawrence@redhat.com> [1-9.el7]
feeec8
- kernel: use-after-free in route4_change() in net/sched/cls_route.c [1997195] {CVE-2021-3715}
feeec8
ad1123
* Mon Aug 16 2021 Joe Lawrence <joe.lawrence@redhat.com> [1-8.el7]
ad1123
- kernel: out-of-bounds write in xt_compat_target_from_user() in net/netfilter/x_tables.c [1980516] {CVE-2021-22555}
ad1123
- kpatch: kernel: race condition for removal of the HCI controller [1971474] {CVE-2021-32399}
ad1123
2b8560
* Fri Jul 09 2021 Joe Lawrence <joe.lawrence@redhat.com> [1-7.el7]
2b8560
- kernel: size_t-to-int conversion vulnerability in the filesystem layer [1975256] {CVE-2021-33909}
2b8560
- kernel: use-after-free in net/bluetooth/hci_event.c when destroying an hci_chan [1962518] {CVE-2021-33034}
2b8560
738669
* Fri May 21 2021 Artem Savkov <asavkov@redhat.com> [1-6.el7]
738669
- Use after free via PI futex state [1935112] {CVE-2021-3347}
738669
a56882
* Fri Mar 26 2021 Joe Lawrence <joe.lawrence@redhat.com> [1-5.el7]
a56882
- kernel: out-of-bounds read in libiscsi module [1930840] {CVE-2021-27364}
a56882
- kernel: heap buffer overflow in the iSCSI subsystem [1930863] {CVE-2021-27365}
a56882
f07e16
* Tue Feb 02 2021 Artem Savkov <asavkov@redhat.com> [1-3.el7]
f07e16
- SCSI target (LIO) write to any block on ILO backstore [1902568] {CVE-2020-28374}
f07e16
f07e16
* Thu Jan 21 2021 Julien Thierry <jthierry@redhat.com> [1-2.el7]
f07e16
- Fix TTY pgrp locking in tiocspgrp [1908206] {CVE-2020-29661}
f07e16
14468b
* Fri Oct 30 2020 Julien Thierry <jthierry@redhat.com> [1-1.el7]
14468b
- xfs: fix boundary test in xfs_attr_shortform_verify [1881413] {CVE-2020-14385}
14468b
749425
* Mon Oct 26 2020 Yannick Cote <ycote@redhat.com> [0-0.el7]
749425
- An empty patch to subscribe to kpatch stream for kernel-3.10.0-1160.6.1.el7 [1891573]