Live Patching
 help / color / mirror / Atom feed
* Re: [PATCH 28/48] objtool/klp: Create empty checksum sections for function-less object files
From: Song Liu @ 2026-04-24 22:08 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <199a3d975e8e562421edd342b9eda242b4f57a71.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> If an object file has no functions, objtool has nothing to checksum, so
> it doesn't create the .discard.sym_checksum symbol.
>
> Then when 'objtool klp diff' reads symbol checksums, it errors out due
> to the missing .discard.sym_checksum section.
>
> Instead, just create an empty checksum section to signal to
> read_sym_checksums() that the file has been processed.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 20/48] klp-build: Don't use errexit
From: Song Liu @ 2026-04-24 22:07 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <f86bf0b781101152b35437bfe0e6a286f3955247.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> The errtrace option (combined with the ERR trap) already serves the same
> function (and more) as errexit, so errexit is redundant.  And it has
> more pitfalls.  Remove it.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 29/48] klp-build: Print "objtool klp diff" command in verbose mode
From: Song Liu @ 2026-04-24 22:02 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <bf64851de287f98a2a94900df0dad7edf3d694c0.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Print the full objtool command line when '--verbose' is given to help
> with debugging.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 27/48] objtool: Include libsubcmd headers directly from source tree
From: Song Liu @ 2026-04-24 21:59 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <d9acc0495f258f58703820274e6045ceb2198d70.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Instead of installing libsubcmd headers to a build output directory and
> including from there, include directly from tools/lib/ where they
> already exist.  This fixes clangd indexing which otherwise can't find
> libsubcmd headers.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 26/48] objtool/klp: Don't set sym->file for section symbols
From: Song Liu @ 2026-04-24 21:58 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Josh Poimboeuf, x86, linux-kernel, live-patching, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <20260423083416.GT3126523@noisy.programming.kicks-ass.net>

On Thu, Apr 23, 2026 at 1:34 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Apr 22, 2026 at 09:03:54PM -0700, Josh Poimboeuf wrote:
> > Section symbols aren't grouped after their corresponding FILE symbols.
> > Their sym->file should really be NULL rather than whatever random FILE
> > happened to be last.
> >
> > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 25/48] klp-build: Reject patches to realmode
From: Song Liu @ 2026-04-24 21:57 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <f5ad8c1b51ba95187f0ed48f2f82056c8320337e.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Realmode code is compiled as a separate 16-bit binary and embedded into
> the kernel image via rmpiggy.S.  It can't be livepatched.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 24/48] klp-build: Reject patches to vDSO
From: Song Liu @ 2026-04-24 21:57 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <b3c113988fbc73f0a988c5cc41cd009cb09a4ed3.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> vDSO code runs in userspace and can't be livepatched.  Such patches also
> cause spurious "new function" errors due to generated files like
> vdso*-image.c having unstable line numbers across builds.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 23/48] klp-build: Fix patch cleanup on interrupt
From: Song Liu @ 2026-04-24 21:56 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <cc513774c7d5063812c66bac421e56e24fccbc42.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> If a build error occurs and the user hits Ctrl-C while a large patch is
> being reverted during cleanup, the cleanup EXIT trap gets re-triggered
> and tries to re-revert the already partially-reverted patch.  That
> causes 'patch -R' to repeatedly prompt
>
>   "Unreversed patch detected!  Ignore -R? [n]"
>
> for each already-reverted hunk, with no way to break out.
>
> Fix it by adding '--force' to the patch revert command in
> revert_patch(), which causes it to silently ignore already-reverted
> hunks.  And ignore errors, as the cleanup is always best-effort.
>
> For similar reasons, add to APPLIED_PATCHES before (rather than after)
> applying the patch in apply_patch() so an interrupted apply will also
> get cleaned up.
>
> Fixes: d36a7343f4ba ("livepatch/klp-build: switch to GNU patch and recountdiff")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 22/48] klp-build: Suppress excessive fuzz output by default
From: Song Liu @ 2026-04-24 21:54 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <58c5ac9ae38760beb06e5ddddb742ea54f922371.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> When a patch applies with fuzz, the detailed output from the patch tool
> can be very noisy, especially for big patches.
>
> Suppress the fuzz details by default, while keeping the "applied with
> fuzz" warning.  The noise can be restored with '--verbose'.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 21/48] klp-build: Validate patch file existence
From: Song Liu @ 2026-04-24 21:53 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <66e3edb75bf1924c650bce43835acc2053d1cf1a.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Make sure all patch files actually exist.  Otherwise there can be
> confusing errors later.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 18/48] klp-build: Fix hang on out-of-date .config
From: Song Liu @ 2026-04-24 21:51 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <1b3add71a35ff83fc9653c2c872b811cfd5629a3.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> If .config is out of date with the kernel source, 'make syncconfig'
> hangs while waiting for user input on new config options.  Detect the
> mismatch and return an error.
>
> Fixes: 6f93f7b06810 ("livepatch/klp-build: Fix inconsistent kernel version")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
>  scripts/livepatch/klp-build | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
> index 0ad7e6631314..81b35fc10877 100755
> --- a/scripts/livepatch/klp-build
> +++ b/scripts/livepatch/klp-build
> @@ -306,7 +306,12 @@ set_kernelversion() {
>
>         stash_file "$file"
>
> -       kernelrelease="$(cd "$SRC" && make syncconfig &>/dev/null && make -s kernelrelease)"
> +       if [[ -n "$(make -s listnewconfig 2>/dev/null)" ]]; then
> +               die ".config mismatch, check your .config or run 'make olddefconfig'"
> +       fi
> +       make syncconfig &>/dev/null || die "make syncconfig failed"
> +
> +       kernelrelease="$(cd "$SRC" && make -s kernelrelease)"

Do we really need cd "$SRC" here? If so, we need it before
all the make commands, right?

Thanks,
Song

>         [[ -z "$kernelrelease" ]] && die "failed to get kernel version"
>
>         sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion
> --
> 2.53.0
>
>

^ permalink raw reply

* Re: [PATCH 17/48] objtool: Fix reloc hash collision in find_reloc_by_dest_range()
From: Song Liu @ 2026-04-24 21:47 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Peter Zijlstra, x86, linux-kernel, live-patching, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <dzwdrnewwsabz5zmbwkyq6tv4vqn6rauhfyuiywwsifxgh7bow@rplzpdtwsafc>

On Thu, Apr 23, 2026 at 9:34 AM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> On Thu, Apr 23, 2026 at 10:32:31AM +0200, Peter Zijlstra wrote:
> > On Wed, Apr 22, 2026 at 09:03:45PM -0700, Josh Poimboeuf wrote:
> > > In find_reloc_by_dest_range(), hash collisions can cause a high-offset
> > > relocation to appear when probing a low-offset hash bucket.
> > >
> > > Only return early when the best match found so far genuinely belongs to
> > > the current bucket (its offset is within the bucket's stride range).
> > > Otherwise, continue scanning later buckets which may contain
> > > lower-offset matches.
> >
> > Maybe mention (and or add a comment to the function) that in case of
> > multiple matches in the given range, it will return the lowest address
> > one.
> >
> > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
> index c4cb371e72b2..af2841b8e095 100644
> --- a/tools/objtool/elf.c
> +++ b/tools/objtool/elf.c
> @@ -347,8 +347,9 @@ void iterate_sym_by_name(const struct elf *elf, const char *name,
>         }
>  }
>
> +/* If there are multiple matches, return the first one in the range */
>  struct reloc *find_reloc_by_dest_range(const struct elf *elf, struct section *sec,
> -                                    unsigned long offset, unsigned int len)
> +                                      unsigned long offset, unsigned int len)
>  {
>         struct reloc *reloc, *r = NULL;
>         struct section *rsec;

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 15/48] objtool/klp: Fix kCFI trap handling
From: Song Liu @ 2026-04-24 21:38 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <2022e064d670290bfc4ce96207c64b2282d39959.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> .kcfi_traps contains references to kCFI trap instruction locations.
> When a KCFI type check fails at an indirect call, the trap handler looks
> up the faulting address in this section.
>
> Add it to the special sections list so the entries get extracted for the
> changed functions they reference.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 14/48] objtool/klp: Fix extraction of text annotations for alternatives
From: Song Liu @ 2026-04-24 21:37 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <5e67de043745aec66abf963edbd74d13c5ea142a.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Objtool is failing to extract text annotations which reference
> .altinstr_replacement instructions:
>
>   1) Alternative replacement fake symbols are NOTYPE rather than FUNC,
>      and they don't have sym->included set, thus they aren't recognized
>      by should_keep_special_sym().
>
>   2) .discard.annotate_insn gets processed before .altinstr_replacement,
>      so the referenced (fake) symbols don't have clones yet.
>
> Fix the first issue by checking for a valid clone instead of
> sym->included and by accepting NOTYPE symbols when processing
> .discard.annotate_insn.
>
> Fix the second issue by deferring text annotation processing until after
> the other special sections have been cloned.
>
> Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 16/48] objtool/klp: Fix relocation conversion failures for R_X86_64_NONE
From: Song Liu @ 2026-04-24 21:35 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <2779114efd74a9dd9f1e78076e1b9e3a5273de73.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:06 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Objtool has some hacks which NOP out certain calls/jumps and replace
> their relocations with R_X86_64_NONE.  The klp-diff relocation
> extraction code will error out when trying to copy these relocations due
> to their negative addend, which would only makes sense for a PC-relative
> branch instruction.  Just ignore them.
>
> Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 13/48] objtool/klp: Fix XXH3 state memory leak
From: Song Liu @ 2026-04-24 21:28 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <b998db762616ed3c4972b64a3f64759d39bfe674.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> The XXH3 state allocated in checksum_init() is never freed.  Free it in
> checksum_finish().
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 12/48] objtool/klp: Fix cloning of zero-length section symbols
From: Song Liu @ 2026-04-24 21:24 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <2a02cb0d5de7a60f5ef135dac071c93f6303bd82.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Fix NULL dereference when cloning a symbol from an empty section.
> sec->data is only populated for sections with non-zero size.
>
> Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 11/48] objtool/klp: Fix handling of zero-length .altinstr_replacement sections
From: Song Liu @ 2026-04-24 21:19 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <99099e77dffb352f97c5276298ab344c186a3ee2.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:05 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> When a section is empty (e.g. only zero-length alternative
> replacements), there are no symbols to convert a section symbol
> reference to.  Skip the reloc instead of erroring out.
>
> Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

With a nitpick below:

[...]

> @@ -1293,12 +1301,15 @@ static int clone_sym_relocs(struct elfs *e, struct symbol *patched_sym)
>                     !strcmp(patched_reloc->sym->sec->name, ".altinstr_aux"))
>                         continue;
>
> -               if (convert_reloc_sym(e->patched, patched_reloc)) {
> +               ret = convert_reloc_sym(e->patched, patched_reloc);
> +               if (ret < 0) {
>                         ERROR_FUNC(patched_rsec->base, reloc_offset(patched_reloc),
>                                    "failed to convert reloc sym '%s' to its proper format",
>                                    patched_reloc->sym->name);
>                         return -1;
>                 }
> +               if (ret > 0)
> +                       continue;

Functions that return -1, 0, 1 are usually more confusing. Shall we add more
comments for convert_reloc_sym()?

Thanks,
Song

^ permalink raw reply

* Re: [PATCH 10/48] objtool/klp: Fix --debug-checksum for duplicate symbol names
From: Song Liu @ 2026-04-24 21:06 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <7fd49264db4f5a9c654ad162cca96ce575e77ae4.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> find_symbol_by_name() only returns the first match, so
> --debug-checksum=<func> silently ignores any subsequent duplicately
> named functions after the first.
>
> Add a new iterate_sym_by_name() to fix that.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 09/48] objtool/klp: Fix create_fake_symbols() skipping entsize-based sections
From: Song Liu @ 2026-04-24 21:00 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <e10231fce5d8f3f17e4cc7a396a4a8e8d791f994.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> From: Joe Lawrence <joe.lawrence@redhat.com>
>
> create_fake_symbols() has two phases: creating symbols from
> ANNOTATE_DATA_SPECIAL entries, and a fallback that uses sh_entsize for
> special sections like .static_call_sites.
>
> When .discard.annotate_data is absent, the function returns early,
> skipping the entsize fallback and silently allowing unsupported
> module-local static call keys through.
>
> Fix it by jumping to the entsize phase instead of returning early.
>
> Fixes: dd590d4d57eb ("objtool/klp: Introduce klp diff subcommand for diffing object files")
> Assisted-by: Claude:claude-4-opus
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 08/48] objtool/klp: Don't correlate __initstub__ symbols
From: Song Liu @ 2026-04-24 20:57 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <b62dafa3c40576c8e82b062bc24116772c272b87.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> With LTO, the initcall infrastructure generates __initstub__kmod_*
> wrapper functions in .init.text.  These are the LTO equivalent of
> __initcall__kmod_* data pointers, which are already excluded from
> correlation.
>
> These are __init functions whose memory is freed after boot, so there's
> no reason to include or reference them in a livepatch module.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 07/48] objtool/klp: Don't correlate absolute symbols
From: Song Liu @ 2026-04-24 20:56 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <1dc8b127ff0b1252e53bb7e6130ed46c60f57c25.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Some arch/x86/crypto/*.S files define local .set/.equ constants that get
> duplicated in vmlinux.o.  This causes klp-diff to fail with "Multiple
> correlation candidates" errors since it can't uniquely match these
> between orig and patched builds.
>
> Skip ABS symbols in dont_correlate().  They're purely compile-time
> assembly constants that are never referenced by relocations, so they
> don't need correlation.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 05/48] objtool: Move mark_rodata() to elf.c
From: Song Liu @ 2026-04-24 20:41 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Miroslav Benes, Petr Mladek
In-Reply-To: <c32b3d8d0770c93f8c0d8e4a989f2f43c29e9a5f.1776916871.git.jpoimboe@kernel.org>

On Wed, Apr 22, 2026 at 9:04 PM Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> Move the sec->rodata marking from check.c to elf.c so it's set during
> ELF reading rather than during the check pipeline.  This makes the
> rodata flag available to all objtool users, including klp-diff which
> reads ELF files directly without running check().
>
> Add an is_rodata_sec() helper to elf.h for consistency with
> is_text_sec() and is_string_sec().
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Acked-by: Song Liu <song@kernel.org>

^ permalink raw reply

* Re: [PATCH 08/48] objtool/klp: Don't correlate __initstub__ symbols
From: Miroslav Benes @ 2026-04-24 12:17 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Song Liu, Miroslav Benes, Petr Mladek
In-Reply-To: <b62dafa3c40576c8e82b062bc24116772c272b87.1776916871.git.jpoimboe@kernel.org>

On Wed, 22 Apr 2026 21:03:36 -0700, Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> With LTO, the initcall infrastructure generates __initstub__kmod_*
> wrapper functions in .init.text.  These are the LTO equivalent of
> __initcall__kmod_* data pointers, which are already excluded from
> correlation.
> 
> These are __init functions whose memory is freed after boot, so there's
> no reason to include or reference them in a livepatch module.
> 
> [...]

Reviewed-by: Miroslav Benes <mbenes@suse.cz>

-- 
Miroslav


^ permalink raw reply

* Re: [PATCH 07/48] objtool/klp: Don't correlate absolute symbols
From: Miroslav Benes @ 2026-04-24 12:04 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, live-patching, Peter Zijlstra, Joe Lawrence,
	Song Liu, Miroslav Benes, Petr Mladek
In-Reply-To: <1dc8b127ff0b1252e53bb7e6130ed46c60f57c25.1776916871.git.jpoimboe@kernel.org>

On Wed, 22 Apr 2026 21:03:35 -0700, Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> Some arch/x86/crypto/*.S files define local .set/.equ constants that get
> duplicated in vmlinux.o.  This causes klp-diff to fail with "Multiple
> correlation candidates" errors since it can't uniquely match these
> between orig and patched builds.
> 
> Skip ABS symbols in dont_correlate().  They're purely compile-time
> assembly constants that are never referenced by relocations, so they
> don't need correlation.
> 
> [...]

Reviewed-by: Miroslav Benes <mbenes@suse.cz>

-- 
Miroslav


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox