Message ID | 20210501043014.33300-14-fllinden@amazon.com |
---|---|
State | New |
Headers | show |
Series | fix backports, add CVE-2021-29155 fixes | expand |
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 8ef1c74eaa11..abf85414c8d1 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -2754,7 +2754,7 @@ static int adjust_reg_min_max_vals(struct bpf_verifier_env *env, * an arbitrary scalar. Disallow all math except * pointer subtraction */ - if (opcode == BPF_SUB){ + if (opcode == BPF_SUB && env->allow_ptr_leaks) { mark_reg_unknown(regs, insn->dst_reg); return 0; }