From: Joe Lawrence <joe.lawrence@redhat.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: live-patching@vger.kernel.org, Song Liu <song@kernel.org>,
Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH v3 09/13] livepatch/klp-build: fix version mismatch when short-circuiting
Date: Mon, 2 Mar 2026 21:20:00 -0500 [thread overview]
Message-ID: <aaZFUL_yCS3_wHnd@redhat.com> (raw)
In-Reply-To: <zyxlceita2k3szzck5fwhhnpinh3twtzpr23xkdxdpj4opkgog@dnsvvttl4r3x>
On Mon, Feb 23, 2026 at 01:13:29PM -0800, Josh Poimboeuf wrote:
> On Tue, Feb 17, 2026 at 11:17:00AM -0500, Joe Lawrence wrote:
> > Maybe I'm starting to see things, but when running 'S 2' builds, I keep
> > getting "vmlinux.o: changed function: override_release". It could be
> > considered benign for quick development work, or confusing. Seems easy
> > enough to stash and avoid.
> >
> > Repro:
> >
> > Start with a clean source tree, setup some basic configs for klp-build:
> >
> > $ make clean && make mrproper
> > $ vng --kconfig
> > $ ./scripts/config --file .config \
> > --set-val CONFIG_FTRACE y \
> > --set-val CONFIG_KALLSYMS_ALL y \
> > --set-val CONFIG_FUNCTION_TRACER y \
> > --set-val CONFIG_DYNAMIC_FTRACE y \
> > --set-val CONFIG_DYNAMIC_DEBUG y \
> > --set-val CONFIG_LIVEPATCH y
> > $ make olddefconfig
> >
> > Build the first patch, save klp-tmp/ (note the added DEBUG that dumps
> > the localversion after assignment in set_kernelversion):
> >
> > $ ./scripts/livepatch/klp-build -T ~/cmdline-string.patch
> > DEBUG: localversion=6.19.0-gc998cd490c02 <<
> > Validating patch(es)
> > Building original kernel
> > Copying original object files
> > Fixing patch(es)
> > Building patched kernel
> > Copying patched object files
> > Diffing objects
> > vmlinux.o: changed function: cmdline_proc_show
> > BMuilding patch module: livepatch-cmdline-string.ko
> > SgUCCESS
> > c
> > Buield a second patch, short-circuit to step 2 (build patched kernel):
> >
> > $ ./scripts/livepatch/klp-build -T -S 2 ~/cmdline-string.patch
> > DEBUG: localversion=6.19.0+ <<
> > Fixing patch(es)
> > Building patched kernel
> > Copying patched object files
> > Diffing objects
> > vmlinux.o: changed function: override_release <<
> > vmlinux.o: changed function: cmdline_proc_show
> > Building patch module: livepatch-cmdline-string.ko
> > SUCCESS
>
> Hm, I wasn't able to recreate, but it's worrisome that two different
> localversions are being reported. How do we know which one is correct?
>
> I'm also not sure why my original code is being so obtuse by
> constructing the kernelrelease manually. I can't remember if that's on
> purpose or not.
>
> The below would be simpler, I wonder if this also happens to fix the
> issue?
>
I finally figured out why you couldn't reproduce, in my tests, I never
built the original kernel, I jumped straight from a clean repo to
starting up klp-build. If I perform an initial make before running
klp-build, then the sequence works as expected.
- If skipping the initial vmlinux is an unsupported use-case, then we
can ignore and drop this patch,
- or perhaps detect and warn/error out
- If this is something we need to support, then your suggested version
below didn't work out either...
The following change committed on top of v7.0-rc2:
diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
index 809e198a561d..f223395e630e 100755
--- a/scripts/livepatch/klp-build
+++ b/scripts/livepatch/klp-build
@@ -285,15 +285,16 @@ set_module_name() {
# application from appending it with '+' due to a dirty git working tree.
set_kernelversion() {
local file="$SRC/scripts/setlocalversion"
- local localversion
+ local kernelrelease
stash_file "$file"
- localversion="$(cd "$SRC" && make --no-print-directory kernelversion)"
- localversion="$(cd "$SRC" && KERNELVERSION="$localversion" ./scripts/setlocalversion)"
- [[ -z "$localversion" ]] && die "setlocalversion failed"
+ kernelrelease="$(cd "$SRC" && make kernelrelease)"
+ [[ -z "$kernelrelease" ]] && die "setlocalversion failed"
- sed -i "2i echo $localversion; exit 0" scripts/setlocalversion
+ echo "DEBUG: kernelrelease=$kernelrelease"
+
+ sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion
}
get_patch_files() {
$ git clone --branch v7.0-rc2 --depth=1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[ add the commit above ]
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
$ vng --kconfig
$ ./scripts/config --file .config \
--set-val CONFIG_FTRACE y \
--set-val CONFIG_KALLSYMS_ALL y \
--set-val CONFIG_FUNCTION_TRACER y \
--set-val CONFIG_DYNAMIC_FTRACE y \
--set-val CONFIG_DYNAMIC_DEBUG y \
--set-val CONFIG_LIVEPATCH y
$ make olddefconfig
$ ./scripts/livepatch/klp-build -T ~/src/linux/cmdline-string.patch
DEBUG: kernelrelease=7.0.0-rc2-00001-g624702e6338b
Validating patch(es)
Building original kernel
Copying original object files
Fixing patch(es)
Building patched kernel
Copying patched object files
Diffing objects
vmlinux.o: changed function: cmdline_proc_show
Building patch module: livepatch-cmdline-string.ko
SUCCESS
$ strings livepatch-cmdline-string.ko | grep vermagic
vermagic=7.0.0-rc2-00001-g624702e6338b SMP preempt mod_unload
$ ./scripts/livepatch/klp-build -T -S 2 ~/src/linux/cmdline-string.patch
DEBUG: kernelrelease=7.0.0-rc2+
Fixing patch(es)
Building patched kernel
Copying patched object files
Diffing objects
vmlinux.o: changed function: override_release
vmlinux.o: changed function: cmdline_proc_show
Building patch module: livepatch-cmdline-string.ko
SUCCESS
$ strings livepatch-cmdline-string.ko | grep vermagic
vermagic=7.0.0-rc2+ SMP preempt mod_unload
--
Joe
next prev parent reply other threads:[~2026-03-03 2:20 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 16:06 [PATCH v3 00/13] livepatch-klp-build: small fixups and enhancements Joe Lawrence
2026-02-17 16:06 ` [PATCH v3 01/13] objtool/klp: honor SHF_MERGE entry alignment in elf_add_data() Joe Lawrence
2026-02-17 16:14 ` Joe Lawrence
2026-03-05 2:33 ` Josh Poimboeuf
2026-03-10 14:02 ` Joe Lawrence
2026-03-10 16:34 ` Josh Poimboeuf
2026-02-17 16:06 ` [PATCH v3 02/13] objtool/klp: fix mkstemp() failure with long paths Joe Lawrence
2026-02-17 17:45 ` Song Liu
2026-02-17 16:06 ` [PATCH v3 03/13] livepatch/klp-build: support patches that add/remove files Joe Lawrence
2026-02-17 17:52 ` Song Liu
2026-02-17 16:06 ` [PATCH v3 04/13] livepatch/klp-build: switch to GNU patch and recountdiff Joe Lawrence
2026-02-17 16:06 ` [PATCH v3 05/13] livepatch/klp-build: add grep-override function Joe Lawrence
2026-02-17 18:22 ` Song Liu
2026-02-17 16:06 ` [PATCH v3 06/13] livepatch/klp-build: add Makefile with check target Joe Lawrence
2026-02-17 18:26 ` Song Liu
2026-02-17 16:06 ` [PATCH v3 07/13] livepatch/klp-build: fix shellcheck complaints Joe Lawrence
2026-02-17 18:30 ` Song Liu
2026-02-17 16:06 ` [PATCH v3 08/13] livepatch/klp-build: improve short-circuit validation Joe Lawrence
2026-02-17 18:29 ` Song Liu
2026-02-17 16:06 ` [PATCH v3 09/13] livepatch/klp-build: fix version mismatch when short-circuiting Joe Lawrence
2026-02-17 16:17 ` Joe Lawrence
2026-02-17 19:25 ` Song Liu
2026-02-18 15:04 ` Joe Lawrence
2026-02-19 2:52 ` Song Liu
2026-02-23 21:13 ` Josh Poimboeuf
2026-03-03 2:20 ` Joe Lawrence [this message]
2026-03-05 22:35 ` Josh Poimboeuf
2026-03-05 22:52 ` [PATCH] klp-build: Fix inconsistent kernel version Josh Poimboeuf
2026-03-10 13:45 ` Joe Lawrence
2026-03-10 16:30 ` Josh Poimboeuf
2026-02-17 16:06 ` [PATCH v3 10/13] livepatch/klp-build: provide friendlier error messages Joe Lawrence
2026-02-17 18:32 ` Song Liu
2026-02-23 21:15 ` Josh Poimboeuf
2026-03-03 2:20 ` Joe Lawrence
2026-02-17 16:06 ` [PATCH v3 11/13] livepatch/klp-build: add terminal color output Joe Lawrence
2026-02-17 16:20 ` Joe Lawrence
2026-02-17 18:45 ` Song Liu
2026-02-23 21:28 ` Josh Poimboeuf
2026-02-23 21:32 ` Josh Poimboeuf
2026-03-03 2:24 ` Joe Lawrence
2026-03-05 20:08 ` Josh Poimboeuf
2026-02-17 16:06 ` [PATCH v3 12/13] livepatch/klp-build: report patch validation drift Joe Lawrence
2026-02-17 19:42 ` Song Liu
2026-02-18 15:09 ` Joe Lawrence
2026-02-23 21:40 ` Josh Poimboeuf
2026-03-03 2:27 ` Joe Lawrence
2026-02-17 16:06 ` [PATCH v3 13/13] livepatch/klp-build: don't look for changed objects in tools/ Joe Lawrence
2026-02-17 19:29 ` Song Liu
2026-02-18 15:18 ` Joe Lawrence
2026-02-19 2:55 ` Song Liu
2026-02-23 21:41 ` Josh Poimboeuf
2026-03-03 2:30 ` Joe Lawrence
2026-03-05 20:10 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaZFUL_yCS3_wHnd@redhat.com \
--to=joe.lawrence@redhat.com \
--cc=jikos@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=pmladek@suse.com \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox