在 2021/7/31 11:14, Yu Changchun 写道:
From: Daniel Borkmann <daniel(a)iogearbox.net>
mainline inclusion
from mainline-v5.13-rc7
commit d203b0fd863a2261e5d00b97f3d060c4c2a6db71
category: bugfix
issue: #I42H19
CVE: CVE-2021-33624
--------------------------------
Instead of relying on current env->pass_cnt, use the seen count from the
old aux data in adjust_insn_aux_data(), and expand it to the new range of
patched instructions. This change is valid given we always expand 1:n
with n>=1, so what applies to the old/original instruction needs to apply
for the replacement as well.
Not relying on env->pass_cnt is a prerequisite for a later change where we
want to avoid marking an instruction seen when verified under speculative
execution path.
Signed-off-by: Daniel Borkmann <daniel(a)iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend(a)gmail.com>
Reviewed-by: Benedict Schlueter <benedict.schlueter(a)rub.de>
Reviewed-by: Piotr Krysiuk <piotras(a)gmail.com>
Acked-by: Alexei Starovoitov <ast(a)kernel.org>
Conflicts:
kernel/bpf/verifier.c
seen of bpf_insn_aux_data is bool in kernel-4.19.
Signed-off-by: He Fengqing <hefengqing(a)huawei.com>
Reviewed-by: Kuohai Xu <xukuohai(a)huawei.com>
Reviewed-by: Xiu Jianfeng <xiujianfeng(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
Signed-off-by: Yu Changchun <yuchangchun1(a)huawei.com>
---
kernel/bpf/verifier.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Looks good to me