Skip to content
/ linux Public

Commit df02c3f

Browse files
aspskSasha Levin
authored andcommitted
bpf: Properly mark live registers for indirect jumps
[ Upstream commit d1aab1c ] For a `gotox rX` instruction the rX register should be marked as used in the compute_insn_live_regs() function. Fix this. Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com> Link: https://lore.kernel.org/r/20260114162544.83253-2-a.s.protopopov@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent aae391a commit df02c3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/bpf/verifier.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24292,6 +24292,12 @@ static void compute_insn_live_regs(struct bpf_verifier_env *env,
2429224292
case BPF_JMP32:
2429324293
switch (code) {
2429424294
case BPF_JA:
24295+
def = 0;
24296+
if (BPF_SRC(insn->code) == BPF_X)
24297+
use = dst;
24298+
else
24299+
use = 0;
24300+
break;
2429524301
case BPF_JCOND:
2429624302
def = 0;
2429724303
use = 0;

0 commit comments

Comments
 (0)