Searched hist:ebaf24c589d7c714b763a80856d1a6df3ba25b84 (Results 1 – 2 of 2) sorted by relevance
/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | netcnt.c | diff ebaf24c589d7c714b763a80856d1a6df3ba25b84 Wed Apr 06 03:54:08 CDT 2022 Artem Savkov <asavkov@redhat.com> selftests/bpf: Use bpf_num_possible_cpus() in per-cpu map allocations
bpf_map_value_size() uses num_possible_cpus() to determine map size, but some of the tests only allocate enough memory for online cpus. This results in out-of-bound writes in userspace during bpf(BPF_MAP_LOOKUP_ELEM) syscalls in cases when number of online cpus is lower than the number of possible cpus. Fix by switching from get_nprocs_conf() to bpf_num_possible_cpus() when determining the number of processors in these tests (test_progs/netcnt and test_cgroup_storage).
Signed-off-by: Artem Savkov <asavkov@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220406085408.339336-1-asavkov@redhat.com
|
/openbmc/linux/tools/testing/selftests/bpf/ |
H A D | test_cgroup_storage.c | diff ebaf24c589d7c714b763a80856d1a6df3ba25b84 Wed Apr 06 03:54:08 CDT 2022 Artem Savkov <asavkov@redhat.com> selftests/bpf: Use bpf_num_possible_cpus() in per-cpu map allocations
bpf_map_value_size() uses num_possible_cpus() to determine map size, but some of the tests only allocate enough memory for online cpus. This results in out-of-bound writes in userspace during bpf(BPF_MAP_LOOKUP_ELEM) syscalls in cases when number of online cpus is lower than the number of possible cpus. Fix by switching from get_nprocs_conf() to bpf_num_possible_cpus() when determining the number of processors in these tests (test_progs/netcnt and test_cgroup_storage).
Signed-off-by: Artem Savkov <asavkov@redhat.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220406085408.339336-1-asavkov@redhat.com
|