]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: fix do_misc_fixups() for bpf_get_branch_snapshot()
authorAndrii Nakryiko <andrii@kernel.org>
Wed, 23 Oct 2024 16:19:16 +0000 (09:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:37 +0000 (02:02 +0100)
commit9bcf8a492275b70c4470a34356423fa8e9cb9ba2
tree4aca8a48599d411978ec037fb10b9fc744f86301
parent585674b9d0d80bd7f428b1f88be13cf6d5d6f739
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@suse.com>
Fixes: 314a53623cd4 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/verifier.c