]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests/bpf: Exercise kptr map update lifetime
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Tue, 9 Jun 2026 20:25:46 +0000 (22:25 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 10 Jun 2026 04:23:11 +0000 (21:23 -0700)
commit2e7c6cb4d8437a2fe7cd95aac7ca53d7eb05e9f4
tree703f21d578314c1ee115b1c9a44ee754bdbd90cf
parent4b84518137ce841eca2acae83096adb829dad05c
selftests/bpf: Exercise kptr map update lifetime

Add focused map_kptr coverage for BPF-side map updates that touch values
containing referenced kptrs.

The new syscall programs stash the testmod refcounted object in an array
map, a preallocated hash map, and a no-prealloc hash map, then update the
same map from BPF. The refcount must remain elevated after the update,
while the userspace runner destroys the skeleton and reuses the existing
refcount wait to confirm map teardown releases the kptr.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260609202548.3571690-5-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/map_kptr.c
tools/testing/selftests/bpf/progs/map_kptr.c