Skip to content

Commit c29a492

Browse files
ytcoodeAlexei Starovoitov
authored andcommitted
bpf: Fix maximum permitted number of arguments check
Since the m->arg_size array can hold up to MAX_BPF_FUNC_ARGS argument sizes, it's ok that nargs is equal to MAX_BPF_FUNC_ARGS. Signed-off-by: Yuntao Wang <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Martin KaFai Lau <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 9887060 commit c29a492

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/bpf/btf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5507,7 +5507,7 @@ int btf_distill_func_proto(struct bpf_verifier_log *log,
55075507
}
55085508
args = (const struct btf_param *)(func + 1);
55095509
nargs = btf_type_vlen(func);
5510-
if (nargs >= MAX_BPF_FUNC_ARGS) {
5510+
if (nargs > MAX_BPF_FUNC_ARGS) {
55115511
bpf_log(log,
55125512
"The function %s has %d arguments. Too many.\n",
55135513
tname, nargs);

0 commit comments

Comments
 (0)