Message ID | 20240314194617.42266-3-bethany.jamison@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,F,1/1] bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS | expand |
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index e132c18f03e23..5a375e28bfeaf 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -4664,6 +4664,10 @@ static int adjust_ptr_min_max_vals(struct bpf_verifier_env *env, verbose(env, "R%d pointer arithmetic on %s prohibited, null-check it first\n", dst, reg_type_str[ptr_reg->type]); return -EACCES; + case PTR_TO_FLOW_KEYS: + if (known) + break; + fallthrough; case CONST_PTR_TO_MAP: /* smin_val represents the known value */ if (known && smin_val == 0 && opcode == BPF_ADD)