Skip to content

Commit 328aac5

Browse files
Ravi Bangoriaborkmann
authored andcommitted
bpf, x86: Fix extable offset calculation
Commit 4c5de12 ("bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.") is emitting a couple of instructions before the actual load. Consider those additional instructions while calculating extable offset. Fixes: 4c5de12 ("bpf: Emit explicit NULL pointer checks for PROBE_LDX instructions.") Signed-off-by: Ravi Bangoria <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent a196fa7 commit 328aac5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/net/bpf_jit_comp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ st: if (is_imm8(insn->off))
12811281
emit_ldx(&prog, BPF_SIZE(insn->code), dst_reg, src_reg, insn->off);
12821282
if (BPF_MODE(insn->code) == BPF_PROBE_MEM) {
12831283
struct exception_table_entry *ex;
1284-
u8 *_insn = image + proglen;
1284+
u8 *_insn = image + proglen + (start_of_ldx - temp);
12851285
s64 delta;
12861286

12871287
/* populate jmp_offset for JMP above */

0 commit comments

Comments
 (0)