Re: [PATCH v3 bpf-next] bpf: add a verbose message if map limit is reached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/2/24 9:33 AM, Anton Protopopov wrote:
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.

v1 -> v2:
   * make the message more clear (Alexey)
v2 -> v3:
   * fixed grammar (Anton)

Signed-off-by: Anton Protopopov <aspsk@xxxxxxxxxxxxx>
Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>
Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>
---
  kernel/bpf/verifier.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index edb650667f44..559526191ae7 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);

Btw, small nit, but might make sense to streamline capitalization across
verbose() messages. Bit of a mix of small and capital letters right now
in the verifier code. Either way, independent of this one.

Cheers,
Daniel




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux