Commit 4b54e3f8 authored by Jiong Wang's avatar Jiong Wang Committed by Yang Yingliang
Browse files

bpf: verifier support JMP32



mainline inclusion
from mainline-v5.1-rc1
commit 092ed096
category: bugfix
bugzilla: NA
CVE: CVE-2021-3444

--------------------------------

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: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarJiong Wang <jiong.wang@netronome.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>

Conflicts:
  kernel/bpf/core.c
  kernel/bpf/verifier.c

Signed-off-by: default avatarHe <Fengqing&lt;hefengqing@huawei.com>
Reviewed-by: default avatarKuohai Xu <xukuohai@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent f8442197
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment