diff --git a/0028-Fix-sym-type-condition-in-locals_match.patch b/0028-Fix-sym-type-condition-in-locals_match.patch new file mode 100644 index 0000000000000000000000000000000000000000..5681fce2ed4138f96a77860fa5c14d9fb002eea6 --- /dev/null +++ b/0028-Fix-sym-type-condition-in-locals_match.patch @@ -0,0 +1,30 @@ +From 4d8c8102de49534bd538bb20319680ce1f1ff9ef Mon Sep 17 00:00:00 2001 +From: Artem Savkov +Date: Thu, 3 Feb 2022 11:59:24 +0100 +Subject: [PATCH] Fix sym->type condition in locals_match() + +Second loop in locals_match() checks table_sym->type instead of +sym->type. + +Fixes: 7207687 Switch to per-file lookup table pointers. +Signed-off-by: Artem Savkov +--- + kpatch-build/lookup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kpatch-build/lookup.c b/kpatch-build/lookup.c +index 0323c61..06f4b38 100644 +--- a/kpatch-build/lookup.c ++++ b/kpatch-build/lookup.c +@@ -131,7 +131,7 @@ static bool locals_match(struct lookup_table *table, int idx, + break; + if (sym->bind != STB_LOCAL) + continue; +- if (sym->type != STT_FUNC && table_sym->type != STT_OBJECT) ++ if (sym->type != STT_FUNC && sym->type != STT_OBJECT) + continue; + /* + * Symbols which get discarded at link time are missing from +-- +2.27.0 + diff --git a/kpatch.spec b/kpatch.spec index 1cff35cea6cc0f972e6a5c926a51e6960cb90c5b..fa1377ece69914e87c0df0057c2a45ede346192a 100644 --- a/kpatch.spec +++ b/kpatch.spec @@ -1,7 +1,7 @@ Name: kpatch Epoch: 1 Version: 0.9.5 -Release: 3 +Release: 4 Summary: A Linux dynamic kernel patching infrastructure License: GPLv2 @@ -40,6 +40,7 @@ Patch0024:0024-kpatch-build-support-CROSS_COMPILE.patch Patch0025:0025-create-diff-object-update-for-__already_done.patch Patch0026:0026-kpatch-build-Add-missing-allocation-failure-checks.patch Patch0027:0027-create-diff-object-add-support-for-.retpoline_sites-.patch +Patch0028:0028-Fix-sym-type-condition-in-locals_match.patch BuildRequires: gcc elfutils-libelf-devel kernel-devel git Requires: bc make gcc patch bison flex openssl-devel @@ -100,6 +101,12 @@ popd %{_mandir}/man1/*.1.gz %changelog +* Sun Feb 6 2022 Zhipeng Xie -1:0.9.5-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix "ERROR: util.o: find_local_syms: 185: found duplicate matches for util.c" + * Wed Jan 26 2022 Zhipeng Xie -1:0.9.5-3 - Type:enhancement - ID:NA