bpf: Fix maximum permitted number of arguments check
[linux-2.6-microblaze.git] / kernel / bpf / btf.c
index 24788ce..0918a39 100644 (file)
@@ -5507,7 +5507,7 @@ int btf_distill_func_proto(struct bpf_verifier_log *log,
        }
        args = (const struct btf_param *)(func + 1);
        nargs = btf_type_vlen(func);
-       if (nargs >= MAX_BPF_FUNC_ARGS) {
+       if (nargs > MAX_BPF_FUNC_ARGS) {
                bpf_log(log,
                        "The function %s has %d arguments. Too many.\n",
                        tname, nargs);