Skip to content

Commit

Permalink
bpf: verifier remove the rejection on BPF_ALU | BPF_ARSH
Browse files Browse the repository at this point in the history
This patch remove the rejection on BPF_ALU | BPF_ARSH as we have supported
them on interpreter and all JIT back-ends

Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Jiong Wang authored and Alexei Starovoitov committed Dec 7, 2018
1 parent 2dc6b10 commit c49f7db
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions kernel/bpf/verifier.c
Original file line number Diff line number Diff line change
@@ -3649,11 +3649,6 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
return -EINVAL;
}

if (opcode == BPF_ARSH && BPF_CLASS(insn->code) != BPF_ALU64) {
verbose(env, "BPF_ARSH not supported for 32 bit ALU\n");
return -EINVAL;
}

if ((opcode == BPF_LSH || opcode == BPF_RSH ||
opcode == BPF_ARSH) && BPF_SRC(insn->code) == BPF_K) {
int size = BPF_CLASS(insn->code) == BPF_ALU64 ? 64 : 32;

0 comments on commit c49f7db

Please sign in to comment.