]> git.ipfire.org Git - thirdparty/linux.git/commit
libbpf: fix off-by-one in emit_signature_match jump offset
authorKP Singh <kpsingh@kernel.org>
Fri, 22 May 2026 21:53:36 +0000 (23:53 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 23 May 2026 14:49:22 +0000 (07:49 -0700)
commit7dd62566e0d108d29034bcff8503b827f8763320
tree38c0df3e5d603d41840f6c66b46e15625c111d7a
parent49b18315be4eecfc36b75f4aecb4d40a87d68a20
libbpf: fix off-by-one in emit_signature_match jump offset

The offset for the cleanup-label jump is computed before the MOV R7
instruction is emitted, but the JMP lands after it. Account for the
extra insn in the offset calculation (-2 instead of -1). Drop the
redundant self-loop in the else branch; gen->error = -ERANGE already
marks the generation as failed.

Fixes: fb2b0e290147 ("libbpf: Update light skeleton for signing")
Signed-off-by: KP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/r/20260522215337.662271-2-kpsingh@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/gen_loader.c