bpf: verifier support JMP32
This patch teach verifier about the new BPF_JMP32 instruction class. Verifier need to treat it similar as the existing BPF_JMP class. A BPF_JMP32 insn needs to go through all checks that have been done on BPF_JMP. Also, verifier is doing runtime optimizations based on the extra info conditional jump instruction could offer, especially when the comparison is between constant and register that the value range of the register could be improved based on the comparison results. These code are updated accordingly. Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
a72dafafbd
commit
092ed0968b
@@ -362,7 +362,8 @@ static int bpf_adj_branches(struct bpf_prog *prog, u32 pos, s32 end_old,
|
||||
insn = prog->insnsi + end_old;
|
||||
}
|
||||
code = insn->code;
|
||||
if (BPF_CLASS(code) != BPF_JMP ||
|
||||
if ((BPF_CLASS(code) != BPF_JMP &&
|
||||
BPF_CLASS(code) != BPF_JMP32) ||
|
||||
BPF_OP(code) == BPF_EXIT)
|
||||
continue;
|
||||
/* Adjust offset of jmps if we cross patch boundaries. */
|
||||
|
||||
Reference in New Issue
Block a user