Blame SPECS/kpatch-patch.spec

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