Blame SPECS/kpatch-patch.spec

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