]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
klp-build: Fix checksum comparison for changed offsets
authorJosh Poimboeuf <jpoimboe@kernel.org>
Sat, 11 Apr 2026 04:49:56 +0000 (21:49 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 May 2026 04:16:02 +0000 (21:16 -0700)
commitba77fe55781a2464f68b6c13b4b31d05abd2abcf
tree9e5df3d652df259e40831137929fbc993145febb
parentcc39ccce7d5bc623100f07dcda070cef1bf690f6
klp-build: Fix checksum comparison for changed offsets

The klp-build -f/--show-first-changed feature uses diff to compare
checksum log lines between original and patched objects.  However, diff
compares entire lines, including the offset field.  When a function is
at a different section offset, the offset field differs even though the
instruction checksum is identical, causing the wrong instruction to be
printed.

Only compare the checksum field when looking for the first changed
instruction.  Also print both the original and patched offsets when they
differ.

Fixes: 78be9facfb5e ("livepatch/klp-build: Add --show-first-changed option to show function divergence")
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
scripts/livepatch/klp-build