Skip to content

Commit

Permalink
bpf: fix do_misc_fixups() for bpf_get_branch_snapshot()
Browse files Browse the repository at this point in the history
We need `goto next_insn;` at the end of patching instead of `continue;`.
It currently works by accident by making verifier re-process patched
instructions.

Reported-by: Shung-Hsi Yu <[email protected]>
Fixes: 314a536 ("bpf: inline bpf_get_branch_snapshot() helper")
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Acked-by: Shung-Hsi Yu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
anakryiko authored and Alexei Starovoitov committed Oct 24, 2024
1 parent 0ee288e commit 9806f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/bpf/verifier.c
Original file line number Diff line number Diff line change
@@ -21210,7 +21210,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
delta += cnt - 1;
env->prog = prog = new_prog;
insn = new_prog->insnsi + i + delta;
continue;
goto next_insn;
}

/* Implement bpf_kptr_xchg inline */

0 comments on commit 9806f28

Please sign in to comment.