diff options
author | Simon Wang <wangchuanguo@inspur.com> | 2022-06-21 23:19:23 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-06-24 15:40:42 +0200 |
commit | 395e942d34a25824457da379baf434b5d6da4dcc (patch) | |
tree | b0f9944fbc7adbb92a6c01d6552a5a68e9d058e4 /kernel/bpf/verifier.c | |
parent | 6dc7a0baf1a70b7d22662d38481824c14ddd80c5 (diff) | |
download | linux-395e942d34a25824457da379baf434b5d6da4dcc.tar.bz2 |
bpf: Replace hard-coded 0 with BPF_K in check_alu_op
Enhance readability a bit.
Signed-off-by: Simon Wang <wangchuanguo@inspur.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20220622031923.65692-1-wangchuanguo@inspur.com
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index a20d7736a5b2..f228141c01c5 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -9096,7 +9096,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) if (opcode == BPF_END || opcode == BPF_NEG) { if (opcode == BPF_NEG) { - if (BPF_SRC(insn->code) != 0 || + if (BPF_SRC(insn->code) != BPF_K || insn->src_reg != BPF_REG_0 || insn->off != 0 || insn->imm != 0) { verbose(env, "BPF_NEG uses reserved fields\n"); |