Skip to contentSkip to conversation

bpf: fix do_misc_fixups() for bpf_get_branch_snapshot()

PATCH Applied Andrii Nakryiko 4 participants 4 messages Oct 23, 2024 – Oct 24, 2024

Subsystems (2)
lore
Share & tools
lore

Andrii Nakryiko

author maintainer
#0 lore raw

PATCH 1/1 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.

Fixes 314a53623cd4 ("bpf: inline bpf_get_branch_snapshot() helper")
---
 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/verifier.c +1 -1
index f9e2f1cd4975..587a6c76e564 100644
@@ -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 */
Signature · 1 line
2.43.5
#3 lore raw
In reply to Andrii Nakryiko
This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf.git (master)
by Alexei Starovoitov <[email protected]>:

Quoted 9 lines · On Wed, 23 Oct 2024 09:19:16 -0700 you wrote:

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.

Fixes 314a53623cd4 ("bpf: inline bpf_get_branch_snapshot() helper")

[...]

Here is the summary with links:
- [bpf] bpf: fix do_misc_fixups() for bpf_get_branch_snapshot()

    https://git.kernel.org/bpf/bpf/c/9806f283140e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html