]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Add tests for the arena offset of globals
authorEmil Tsalapatis <emil@etsalapatis.com>
Tue, 16 Dec 2025 17:33:25 +0000 (12:33 -0500)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 16 Dec 2025 18:42:55 +0000 (10:42 -0800)
commit19f12431b6c339416e656c794a26ff0ebb2dba56
tree8fc1111e46e66d1eb7ffbab9c4c0641426aea3db
parentc1f61171d44b19834cf24def2cf832f2688e83df
selftests/bpf: Add tests for the arena offset of globals

Add tests for the new libbpf globals arena offset logic. The
tests cover the case of globals being as large as the arena
itself, and being smaller than the arena. In that case, the
data is placed at the end of the arena, and the beginning
of the arena is free.

Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20251216173325.98465-6-emil@etsalapatis.com
tools/testing/selftests/bpf/prog_tests/verifier.c
tools/testing/selftests/bpf/progs/verifier_arena_globals1.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/verifier_arena_globals2.c [new file with mode: 0644]