diff --git a/0051-CDO-Handle-.data.once-sections.patch b/0051-CDO-Handle-.data.once-sections.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce63fc0408465389b4dce674587d8475d89dc5c8 --- /dev/null +++ b/0051-CDO-Handle-.data.once-sections.patch @@ -0,0 +1,47 @@ +From 835d9d1ae10c7483744074689291f3afb34bc2b5 Mon Sep 17 00:00:00 2001 +From: Song Liu +Date: Fri, 25 Apr 2025 16:28:23 -0700 +Subject: [PATCH] CDO: Handle .data..once sections. + +Upstream commit [1] renamed .data.once section as .data..once. Handle it +the same as .data.once sections. + +[1] dbefa1f31a91 ("Rename .data.once to .data..once to fix resetting WARN*_ONCE") +Signed-off-by: Song Liu +--- + kpatch-build/create-diff-object.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c +index a5473b0..3a568a3 100644 +--- a/kpatch-build/create-diff-object.c ++++ b/kpatch-build/create-diff-object.c +@@ -372,7 +372,8 @@ static bool is_special_static(struct symbol *sym) + if (sym->type != STT_OBJECT || sym->bind != STB_LOCAL) + return false; + +- if (!strcmp(sym->sec->name, ".data.once")) ++ if (!strcmp(sym->sec->name, ".data.once") || ++ !strcmp(sym->sec->name, ".data..once")) + return true; + + for (var_name = var_names; *var_name; var_name++) { +@@ -1734,11 +1735,13 @@ static void kpatch_verify_patchability(struct kpatch_elf *kelf) + + /* + * ensure we aren't including .data.* or .bss.* +- * (.data.unlikely and .data.once is ok b/c it only has __warned vars) ++ * (.data.unlikely, .data.once, and .data..once is ok b/c it only ++ * has __warned vars) + */ + if (sec->include && sec->status != NEW && + (!strncmp(sec->name, ".data", 5) || !strncmp(sec->name, ".bss", 4)) && +- (strcmp(sec->name, ".data.unlikely") && strcmp(sec->name, ".data.once"))) { ++ (strcmp(sec->name, ".data.unlikely") && strcmp(sec->name, ".data.once") && ++ strcmp(sec->name, ".data..once"))) { + log_normal("data section %s selected for inclusion\n", + sec->name); + errs++; +-- +2.33.0 + diff --git a/kpatch.spec b/kpatch.spec index b6f3eedb3896f396fb606463f660dec0d902e567..71caab9d16aae8501db7c9eeb8fa49cfd5232bd1 100644 --- a/kpatch.spec +++ b/kpatch.spec @@ -1,7 +1,7 @@ Name: kpatch Epoch: 1 Version: 0.9.5 -Release: 10 +Release: 11 Summary: A Linux dynamic kernel patching infrastructure License: GPLv2 @@ -63,6 +63,7 @@ Patch0047:0047-kpatch-Add-sw64-architecture.patch Patch0048:0048-add-loongarch64-support-for-kpatch.patch Patch0049:0049-lookup-skip-duplicate-local-symbol-table-check-for-f.patch Patch0050:0050-backport-upstream-patches-to-fix-stripping-of-source.patch +Patch0051:0051-CDO-Handle-.data.once-sections.patch BuildRequires: gcc elfutils-libelf-devel kernel-devel git Requires: bc make gcc patch bison flex openssl-devel @@ -123,6 +124,12 @@ popd %{_mandir}/man1/*.1.gz %changelog +* Mon Aug 04 2025 jinsaihang - 1:0.9.5-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:CDO: Handle .data..once sections. + * Tue Jun 25 2024 caixiaomeng - 1:0.9.5-10 - Type:bugfix - ID:NA