Skip to content

Commit 9806f28

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
bpf: fix do_misc_fixups() for bpf_get_branch_snapshot()
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 <shung-hsi.yu@suse.com> Fixes: 314a536 ("bpf: inline bpf_get_branch_snapshot() helper") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Yonghong Song <yonghong.song@linux.dev> Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com> Link: https://lore.kernel.org/r/20241023161916.2896274-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 0ee288e commit 9806f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/verifier.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21210,7 +21210,7 @@ static int do_misc_fixups(struct bpf_verifier_env *env)
2121021210
delta += cnt - 1;
2121121211
env->prog = prog = new_prog;
2121221212
insn = new_prog->insnsi + i + delta;
21213-
continue;
21213+
goto next_insn;
2121421214
}
2121521215

2121621216
/* Implement bpf_kptr_xchg inline */

0 commit comments

Comments
 (0)