Blame SPECS/kpatch-patch.spec

498dbc
# Set to 1 if building an empty subscription-only package.
36d4f3
%define empty_package		0
498dbc
498dbc
#######################################################
498dbc
# Only need to update these variables and the changelog
498dbc
%define kernel_ver	3.10.0-1160.102.1.el7
498dbc
%define kpatch_ver	0.9.2
36d4f3
%define rpm_ver		1
1c5d26
%define rpm_rel		4
498dbc
498dbc
%if !%{empty_package}
498dbc
# Patch sources below. DO NOT REMOVE THIS LINE.
36d4f3
#
36d4f3
# https://issues.redhat.com/browse/RHEL-9077
36d4f3
Source100: CVE-2023-3611.patch
36d4f3
#
36d4f3
# https://issues.redhat.com/browse/RHEL-9208
36d4f3
Source101: CVE-2023-3776.patch
36d4f3
#
36d4f3
# https://issues.redhat.com/browse/RHEL-9016
36d4f3
Source102: CVE-2023-4128.patch
1cfc9d
#
1cfc9d
# https://issues.redhat.com/browse/RHEL-8456
1cfc9d
Source103: CVE-2023-42753.patch
675592
#
675592
# https://issues.redhat.com/browse/RHEL-8831
675592
Source104: CVE-2022-42896.patch
675592
#
675592
# https://issues.redhat.com/browse/RHEL-12767
675592
Source105: CVE-2023-31436.patch
675592
#
675592
# https://issues.redhat.com/browse/RHEL-15213
675592
Source106: CVE-2023-45871.patch
675592
#
675592
# https://issues.redhat.com/browse/RHEL-14416
675592
Source107: CVE-2023-4921.patch
1c5d26
#
1c5d26
# https://issues.redhat.com/browse/RHEL-17942
1c5d26
Source108: CVE-2023-4622.patch
1c5d26
#
1c5d26
# https://issues.redhat.com/browse/RHEL-16619
1c5d26
Source109: CVE-2023-4623.patch
498dbc
# End of patch sources. DO NOT REMOVE THIS LINE.
498dbc
%endif
498dbc
498dbc
%define sanitized_rpm_rel	%{lua: print((string.gsub(rpm.expand("%rpm_rel"), "%.", "_")))}
498dbc
%define sanitized_kernel_ver	%{lua: print((string.gsub(string.gsub(rpm.expand("%kernel_ver"), ".el7", ""), "%.", "_")))}
498dbc
%define kernel_ver_arch	%{kernel_ver}.%{_arch}
498dbc
498dbc
Name:		kpatch-patch-%{sanitized_kernel_ver}
498dbc
Version:	%{rpm_ver}
498dbc
Release:	%{rpm_rel}.el7
498dbc
498dbc
%if %{empty_package}
498dbc
Summary:	Initial empty kpatch-patch for kernel-%{kernel_ver_arch}
498dbc
%else
498dbc
Summary:	Live kernel patching module for kernel-%{kernel_ver_arch}
498dbc
%endif
498dbc
498dbc
Group:		System Environment/Kernel
498dbc
License:	GPLv2
498dbc
ExclusiveArch:	x86_64 ppc64le
498dbc
498dbc
Conflicts:	%{name} < %{version}-%{release}
498dbc
498dbc
Provides:	kpatch-patch = %{kernel_ver_arch}
498dbc
Provides:	kpatch-patch = %{kernel_ver}
498dbc
498dbc
%if !%{empty_package}
498dbc
Requires:	systemd
498dbc
%endif
498dbc
Requires:	kpatch >= 0.4.0-3
498dbc
Requires:	kernel-uname-r = %{kernel_ver_arch}
498dbc
498dbc
%if !%{empty_package}
498dbc
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
498dbc
BuildRequires:	kernel-devel = %{kernel_ver}
498dbc
BuildRequires:	kernel-debuginfo = %{kernel_ver}
498dbc
498dbc
%ifarch x86_64
498dbc
BuildRequires: pesign
498dbc
%endif
498dbc
498dbc
%ifarch ppc64le
498dbc
BuildRequires: gcc-plugin-devel
498dbc
%endif
498dbc
498dbc
Source0:	https://github.com/dynup/kpatch/archive/v%{kpatch_ver}.tar.gz
498dbc
498dbc
Source10:	kernel-%{kernel_ver}.src.rpm
498dbc
498dbc
# kpatch-build patches
498dbc
# Patch1: backport.patch
498dbc
Patch1: v0.9.2-backport-MR-1281-create-diff-object-add-suppo.patch
498dbc
Patch2: v0.9.2-backport-MR-1200-Make-sure-section-symbols-ex.patch
498dbc
498dbc
%global _dupsign_opts --keyname=rhelkpatch1
498dbc
498dbc
%define builddir	%{_builddir}/kpatch-%{kpatch_ver}
498dbc
%define kpatch		%{_sbindir}/kpatch
498dbc
%define kmoddir		%{_usr}/lib/kpatch/%{kernel_ver_arch}
498dbc
%define patchmodname	kpatch-%{sanitized_kernel_ver}-%{version}-%{sanitized_rpm_rel}
498dbc
%define patchmod	%{patchmodname}.ko
498dbc
498dbc
%define _missing_build_ids_terminate_build 1
498dbc
%define _find_debuginfo_opts -r
498dbc
%undefine _include_minidebuginfo
498dbc
%undefine _find_debuginfo_dwz_opts
498dbc
498dbc
%description
498dbc
This is a kernel live patch module which can be loaded by the kpatch
498dbc
command line utility to modify the code of a running kernel.  This patch
498dbc
module is targeted for kernel-%{kernel_ver}.
498dbc
498dbc
%prep
498dbc
%autosetup -n kpatch-%{kpatch_ver} -p1
498dbc
498dbc
%build
498dbc
kdevdir=/usr/src/kernels/%{kernel_ver_arch}
498dbc
vmlinux=/usr/lib/debug/lib/modules/%{kernel_ver_arch}/vmlinux
498dbc
498dbc
# kpatch-build
498dbc
make -C kpatch-build
498dbc
498dbc
# patch module
498dbc
for i in %{sources}; do
498dbc
	[[ $i == *.patch ]] && patch_sources="$patch_sources $i"
498dbc
done
498dbc
export CACHEDIR="%{builddir}/.kpatch"
498dbc
kpatch-build/kpatch-build -n %{patchmodname} -r %{SOURCE10} -v $vmlinux --skip-cleanup $patch_sources || { cat "${CACHEDIR}/build.log"; exit 1; }
498dbc
498dbc
498dbc
%install
498dbc
installdir=%{buildroot}/%{kmoddir}
498dbc
install -d $installdir
498dbc
install -m 755 %{builddir}/%{patchmod} $installdir
498dbc
498dbc
498dbc
%files
498dbc
%{_usr}/lib/kpatch
498dbc
498dbc
498dbc
%post
498dbc
if [[ %{kernel_ver_arch} = $(uname -r) ]]; then
498dbc
	cver="%{rpm_ver}_%{rpm_rel}"
498dbc
	pname=$(echo "kpatch_%{sanitized_kernel_ver}" | sed 's/-/_/')
498dbc
498dbc
	lver=$({ %{kpatch} list | sed -nr "s/^${pname}_([0-9_]+)\ \[enabled\]$/\1/p"; echo "${cver}"; } | sort -V | tail -1)
498dbc
498dbc
	if [ "${lver}" != "${cver}" ]; then
498dbc
		echo "WARNING: at least one loaded kpatch-patch (${pname}_${lver}) has a newer version than the one being installed."
498dbc
		echo "WARNING: You will have to reboot to load a downgraded kpatch-patch"
498dbc
	else
498dbc
		%{kpatch} load %{kmoddir}/%{patchmod}
498dbc
	fi
498dbc
fi
498dbc
%{kpatch} install -k %{kernel_ver_arch} %{kmoddir}/%{patchmod}
498dbc
sync
498dbc
exit 0
498dbc
498dbc
498dbc
%postun
498dbc
%{kpatch} uninstall -k %{kernel_ver_arch} %{patchmod}
498dbc
sync
498dbc
exit 0
498dbc
498dbc
%else
498dbc
%description
498dbc
This is an empty kpatch-patch package which does not contain any real patches.
498dbc
It is only a method to subscribe to the kpatch stream for kernel-%{kernel_ver}.
498dbc
498dbc
%files
498dbc
%doc
498dbc
%endif
498dbc
498dbc
%changelog
1c5d26
* Tue Apr 16 2024 Yannick Cote <ycote@redhat.com> [1-4.el7]
1c5d26
- kernel: net/sched: sch_hfsc UAF [RHEL-16619] {CVE-2023-4623}
1c5d26
- kernel: use after free in unix_stream_sendpage [RHEL-17942] {CVE-2023-4622}
1c5d26
675592
* Wed Mar 06 2024 Yannick Cote <ycote@redhat.com> [1-3.el7]
675592
- kernel: use-after-free in sch_qfq network scheduler [RHEL-14416] {CVE-2023-4921}
675592
- kernel: IGB driver inadequate buffer size for frames larger than MTU [RHEL-15213] {CVE-2023-45871}
675592
- kernel: out-of-bounds write in qfq_change_class function [RHEL-12767] {CVE-2023-31436}
675592
- kernel: use-after-free in l2cap_connect and l2cap_le_connect_req in net/bluetooth/l2cap_core.c [RHEL-8831] {CVE-2022-42896}
675592
1cfc9d
* Fri Jan 05 2024 Yannick Cote <ycote@redhat.com> [1-2.el7]
1cfc9d
- kernel: netfilter: potential slab-out-of-bound access due to integer underflow [RHEL-8456] {CVE-2023-42753}
1cfc9d
36d4f3
* Mon Nov 13 2023 Yannick Cote <ycote@redhat.com> [1-1.el7]
36d4f3
- kernel: net/sched: Use-after-free vulnerabilities in the net/sched classifiers: cls_fw, cls_u32 and cls_route [RHEL-9016] {CVE-2023-4128}
36d4f3
- kernel: net/sched: cls_fw component can be exploited as result of failure in tcf_change_indev function [RHEL-9208] {CVE-2023-3776}
36d4f3
- kernel: net/sched: sch_qfq component can be exploited if in qfq_change_agg function happens qfq_enqueue overhead [RHEL-9077] {CVE-2023-3611}
36d4f3
498dbc
* Mon Sep 25 2023 Yannick Cote <ycote@redhat.com> [0-0.el7]
498dbc
- An empty patch to subscribe to kpatch stream for kernel-3.10.0-1160.102.1.el7 [RHEL-9239]