From: Anton Protopopov Date: Tue, 2 Apr 2024 07:33:47 +0000 (+0000) Subject: bpf: Add a verbose message if map limit is reached X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9dc182c58b5f5d4ac125ac85ad553f7142aa08d4;p=linux.git bpf: Add a verbose message if map limit is reached When more than 64 maps are used by a program and its subprograms the verifier returns -E2BIG. Add a verbose message which highlights the source of the error and also print the actual limit. Signed-off-by: Anton Protopopov Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20240402073347.195920-1-aspsk@isovalent.com --- diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index edb650667f44d..fcb62300f4070 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -18348,6 +18348,8 @@ static int resolve_pseudo_ldimm64(struct bpf_verifier_env *env) } if (env->used_map_cnt >= MAX_USED_MAPS) { + verbose(env, "The total number of maps per program has reached the limit of %u\n", + MAX_USED_MAPS); fdput(f); return -E2BIG; }