* [PATCH bpf-next] bpf: add a verbose message if map limit is reached
@ 2024-03-29 7:20 Anton Protopopov
2024-03-29 14:37 ` Yonghong Song
2024-03-29 16:18 ` Alexei Starovoitov
0 siblings, 2 replies; 3+ messages in thread
From: Anton Protopopov @ 2024-03-29 7:20 UTC (permalink / raw
To: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Jiri Olsa,
Martin KaFai Lau, Stanislav Fomichev, Yonghong Song, bpf
Cc: Anton Protopopov
When more than 64 maps are used by a program the verifier return -E2BIG.
Add a verbose message which highlights the error and also prints the
actual limit.
Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
---
kernel/bpf/verifier.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 58952f040761..fa73009d05bc 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 map usage limit of %u is reached\n",
+ MAX_USED_MAPS);
fdput(f);
return -E2BIG;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] bpf: add a verbose message if map limit is reached
2024-03-29 7:20 [PATCH bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
@ 2024-03-29 14:37 ` Yonghong Song
2024-03-29 16:18 ` Alexei Starovoitov
1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2024-03-29 14:37 UTC (permalink / raw
To: Anton Protopopov, Alexei Starovoitov, Andrii Nakryiko,
Daniel Borkmann, Jiri Olsa, Martin KaFai Lau, Stanislav Fomichev,
bpf
On 3/29/24 12:20 AM, Anton Protopopov wrote:
> When more than 64 maps are used by a program the verifier return -E2BIG.
> Add a verbose message which highlights the error and also prints the
> actual limit.
>
> Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] bpf: add a verbose message if map limit is reached
2024-03-29 7:20 [PATCH bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
2024-03-29 14:37 ` Yonghong Song
@ 2024-03-29 16:18 ` Alexei Starovoitov
1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2024-03-29 16:18 UTC (permalink / raw
To: Anton Protopopov
Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann, Jiri Olsa,
Martin KaFai Lau, Stanislav Fomichev, Yonghong Song, bpf
On Fri, Mar 29, 2024 at 12:18 AM Anton Protopopov <aspsk@isovalent.com> wrote:
>
> When more than 64 maps are used by a program the verifier return -E2BIG.
> Add a verbose message which highlights the error and also prints the
> actual limit.
>
> Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
> ---
> kernel/bpf/verifier.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 58952f040761..fa73009d05bc 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 map usage limit of %u is reached\n",
> + MAX_USED_MAPS);
"map usage limit" reads as "number of times the map was used".
Please make it clear that it's the total number of maps
used by a program and its subprograms.
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-29 16:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 7:20 [PATCH bpf-next] bpf: add a verbose message if map limit is reached Anton Protopopov
2024-03-29 14:37 ` Yonghong Song
2024-03-29 16:18 ` Alexei Starovoitov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.