Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 140d8b33 authored by Wei-Chun Chao's avatar Wei-Chun Chao Committed by David S. Miller
Browse files

bpf: fix bpf_perf_event_read() loop upper bound



Verifier rejects programs incorrectly.

Fixes: 35578d79 ("bpf: Implement function bpf_perf_event_read()")
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarWei-Chun Chao <weichunc@plumgrid.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dcef7070
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -853,7 +853,7 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id)
	if (!map)
		return 0;

	for (i = 0; i <= ARRAY_SIZE(func_limit); i++) {
	for (i = 0; i < ARRAY_SIZE(func_limit); i++) {
		bool_map = (map->map_type == func_limit[i].map_type);
		bool_func = (func_id == func_limit[i].func_id);
		/* only when map & func pair match it can continue.