summaryrefslogtreecommitdiff
path: root/scripts/kconfig/tests/conditional_dep/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2026-04-03 11:57:02 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2026-05-04 21:16:06 -0700
commitcca84cb12908f1cfcecaef80a7692017e2d6a945 (patch)
treea64d268c6df137ea25d408c153f1d2be7755eb06 /scripts/kconfig/tests/conditional_dep/git@git.tavy.me:linux.git
parent3ee67629b2b7fbe270f6c21d9a95219bbd214630 (diff)
objtool/klp: Fix position-dependent checksums for non-relocated jumps/calls
When computing klp checksums, instructions with non-relocated jump/call destination offsets are problematic because the offset values can change when surrounding code has moved, causing the function to be incorrectly marked as changed. Specifically, that includes jumps from alternatives to the end of the alternative, which from objtool's perspective are jumps to the end of the alternative instruction block in the original function. Note that 'jump_dest' jumps don't include sibling calls (those use call_dest), nor do they include jumps to/from .cold sub functions (those are cross-section and need a reloc). Fix it by hashing the opcode bytes (excluding the immediate operand) along with a position-independent representation of the destination. For calls, use the function name, and for jumps, use the destination's offset within its function. [Note the "9 bit hole" comment was wrong: it has been 8 bits since commit 70589843b36f ("objtool: Add option to trace function validation") added the 'trace' field. Adding the 4-bit 'immediate_len' field now leaves a 4-bit hole.] Fixes: 0d83da43b1e1 ("objtool/klp: Add --checksum option to generate per-function checksums") Acked-by: Song Liu <song@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'scripts/kconfig/tests/conditional_dep/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions