From d0cfe23f7ec4fc1638a60230f0d61b43a9e30358 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Jun 28 2023 18:27:49 +0000 Subject: Disable invalid bpf_prog_info check as it causes perf to abort - Support building with pahole >= 1.24 Signed-off-by: Michel Alexandre Salim --- diff --git a/SOURCES/fix-for-pahole-1-24.patch b/SOURCES/fix-for-pahole-1-24.patch new file mode 100644 index 0000000..381ad34 --- /dev/null +++ b/SOURCES/fix-for-pahole-1-24.patch @@ -0,0 +1,16 @@ +Support building with pahole >= 1.24, see +Stefan Roesch's post here https://devkernel.io/posts/pahole-error/ +--- a/scripts/link-vmlinux.sh ++++ b/scripts/link-vmlinux.sh +@@ -240,6 +240,11 @@ gen_btf() + if [ "${pahole_ver}" -ge "121" ]; then + extra_paholeopt="${extra_paholeopt} --btf_gen_floats" + fi ++ if [ "${pahole_ver}" -ge "124" ]; then ++ # pahole 1.24 and above generate BTF_KIND_ENUM64 which is ++ # not supported by this kernel ++ extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_enum64" ++ fi + + info "BTF" ${2} + LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${extra_paholeopt} ${1} diff --git a/SOURCES/perf-disable-invalid-bpf_prog_info-warning.patch b/SOURCES/perf-disable-invalid-bpf_prog_info-warning.patch new file mode 100644 index 0000000..bf48115 --- /dev/null +++ b/SOURCES/perf-disable-invalid-bpf_prog_info-warning.patch @@ -0,0 +1,14 @@ +--- a/tools/perf/util/header.c ++++ b/tools/perf/util/header.c +@@ -3044,11 +3044,6 @@ static int process_bpf_prog_info(struct + if (do_read_u32(ff, &data_len)) + goto out; + +- if (info_len > sizeof(struct bpf_prog_info)) { +- pr_warning("detected invalid bpf_prog_info\n"); +- goto out; +- } +- + info_linear = malloc(sizeof(struct bpf_prog_info_linear) + + data_len); + if (!info_linear) diff --git a/SPECS/kernel.spec b/SPECS/kernel.spec index 00caaa9..5bf76ac 100755 --- a/SPECS/kernel.spec +++ b/SPECS/kernel.spec @@ -115,7 +115,7 @@ Summary: The Linux kernel %define patchlevel 14 # allow pkg_release to have configurable %%{?dist} tag -%define specrelease 76.hs2%{?buildid}%{?dist} +%define specrelease 76.hs3%{?buildid}%{?dist} %define pkg_release %{specrelease} @@ -799,6 +799,10 @@ Source4000: README.rst %if !%{nopatches} Patch1: patch-%{stableversion}-redhat.patch + +Patch100: perf-disable-invalid-bpf_prog_info-warning.patch +Patch101: fix-for-pahole-1-24.patch + %endif # empty final patch to facilitate testing of kernel patches @@ -1313,6 +1317,11 @@ ApplyOptionalPatch patch-%{stableversion}-redhat.patch ApplyOptionalPatch linux-kernel-test.patch +# this causes perf to abort; disable it +ApplyPatch perf-disable-invalid-bpf_prog_info-warning.patch +# support building with pahole >= 1.24 +ApplyPatch fix-for-pahole-1-24.patch + # END OF PATCH APPLICATIONS # Any further pre-build tree manipulations happen here. @@ -2833,6 +2842,11 @@ fi # # %changelog +* Wed Jun 28 2023 Michel Alexandre Salim - 5.14.0-76.hs3.el8 +- Hotfix build +- Disable invalid bpf_prog_info check as it causes perf to abort +- Support building with pahole >= 1.24 + * Wed Jul 06 2022 Davide Cavalca - 5.14.0-76.hs2.el8 - Hotfix build - Drop perl dependency for perf on el8 to avoid modularity issues