bpf: verifier remove the rejection on BPF_ALU | BPF_ARSH
authorJiong Wang <jiong.wang@netronome.com>
Wed, 5 Dec 2018 18:52:35 +0000 (13:52 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 7 Dec 2018 21:30:48 +0000 (13:30 -0800)
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>
kernel/bpf/verifier.c

index 7658c61c1a88406cf757c2d038fd2518b6321dff..2752d35ad0738a7323b8c4470be4579027ae403e 100644 (file)
@@ -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;