This is a note to let you know that I've just added the patch titled bpf: fix do_misc_fixups() for bpf_get_branch_snapshot() to the 6.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bpf-fix-do_misc_fixups-for-bpf_get_branch_snapshot.patch and it can be found in the queue-6.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 964f93256ab94d14a667c9958ea0969614be5a53 Author: Andrii Nakryiko <andrii@xxxxxxxxxx> Date: Wed Oct 23 09:19:16 2024 -0700 bpf: fix do_misc_fixups() for bpf_get_branch_snapshot() [ Upstream commit 9806f283140ef3e4d259b7646bd8c66026bbaac5 ] 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@xxxxxxxx> Fixes: 314a53623cd4 ("bpf: inline bpf_get_branch_snapshot() helper") Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx> Acked-by: Shung-Hsi Yu <shung-hsi.yu@xxxxxxxx> Link: https://lore.kernel.org/r/20241023161916.2896274-1-andrii@xxxxxxxxxx Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 62efe7f0aa46f..77b60896200ef 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -20675,7 +20675,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 */