Summary
The map_kptr test has been denylisted in the BPF CI DENYLIST configurations
since early 2026 due to two separate failures. Both underlying issues have been
fixed by commits that are already in the current tree, but the DENYLIST entries
were never removed. The test should be re-enabled.
Failure Details
- Test / Component:
map_kptr (serial_test_map_kptr in prog_tests/map_kptr.c)
- Frequency: Denylisted — 0% of CI runs execute this test currently
- Failure mode: Two distinct failures, both now fixed
- Affected architectures: All (x86_64 confirmed, aarch64 confirmed in fix commit)
- CI DENYLIST locations:
kernel-patches/vmtest: ci/vmtest/configs/DENYLIST line 3
libbpf/ci: ci/vmtest/configs/DENYLIST line 4
Root Cause Analysis
Two separate issues caused map_kptr to fail:
Issue 1: RCU Tasks Trace kprobe breakage (fixed 2026-02-11)
Commit c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast")
removed the function that map_kptr was kprobing to synchronize RCU Tasks Trace
grace periods. The test's kern_sync_rcu_tasks_trace() helper relied on a kprobe
that no longer had a target.
Fix: Commit 2669dde7a8c6 ("selftests/bpf: Fix map_kptr grace period wait")
replaced the kprobe-based approach with a new kfunc
bpf_kfunc_call_test_call_rcu_tasks_trace() in bpf_testmod that directly invokes
call_rcu_tasks_trace() and signals completion via a shared variable.
Issue 2: queue_work race on map free (fixed 2026-01-15)
wait_for_map_release() was using kern_sync_rcu() to wait for map freeing, but
the queue_work(system_dfl_wq, &map->work) in bpf_map_free_in_work() could
take longer than the RCU grace period, causing test_map_kptr_ref1 to see stale
reference counts (retval error 2).
Fix: Commit efad162f5a84 ("selftests/bpf: Fix map_kptr test failure") added a
count_ref BPF program and wait_for_map_release() that polls until the
reference count drops to 2, rather than relying on a single kern_sync_rcu()
call.
Both fixes are confirmed present in the current tree:
2669dde7a8c6 (2026-02-11): tools/testing/selftests/bpf/progs/rcu_tasks_trace_gp.c,
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
efad162f5a84 (2026-01-15): tools/testing/selftests/bpf/prog_tests/map_kptr.c,
tools/testing/selftests/bpf/progs/map_kptr.c
Proposed Fix
Remove the map_kptr line from both CI DENYLIST files:
kernel-patches/vmtest: ci/vmtest/configs/DENYLIST
libbpf/ci: ci/vmtest/configs/DENYLIST
No in-tree kernel changes needed — the test code is already fixed.
Impact
The map_kptr test exercises critical BPF functionality:
- kptr reference counting in BPF maps (array, hash, LRU, percpu variants)
- kptr operations in local storage maps (task, cgroup, inode, sk)
- kptr in map-in-map configurations
- Proper cleanup of kptr references on map free
With the test denylisted, regressions in any of these areas would go undetected
by CI.
References
Summary
The
map_kptrtest has been denylisted in the BPF CI DENYLIST configurationssince early 2026 due to two separate failures. Both underlying issues have been
fixed by commits that are already in the current tree, but the DENYLIST entries
were never removed. The test should be re-enabled.
Failure Details
map_kptr(serial_test_map_kptr in prog_tests/map_kptr.c)kernel-patches/vmtest: ci/vmtest/configs/DENYLIST line 3libbpf/ci: ci/vmtest/configs/DENYLIST line 4Root Cause Analysis
Two separate issues caused
map_kptrto fail:Issue 1: RCU Tasks Trace kprobe breakage (fixed 2026-02-11)
Commit c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast")
removed the function that
map_kptrwas kprobing to synchronize RCU Tasks Tracegrace periods. The test's
kern_sync_rcu_tasks_trace()helper relied on a kprobethat no longer had a target.
Fix: Commit 2669dde7a8c6 ("selftests/bpf: Fix map_kptr grace period wait")
replaced the kprobe-based approach with a new kfunc
bpf_kfunc_call_test_call_rcu_tasks_trace()in bpf_testmod that directly invokescall_rcu_tasks_trace()and signals completion via a shared variable.Issue 2: queue_work race on map free (fixed 2026-01-15)
wait_for_map_release()was usingkern_sync_rcu()to wait for map freeing, butthe
queue_work(system_dfl_wq, &map->work)inbpf_map_free_in_work()couldtake longer than the RCU grace period, causing
test_map_kptr_ref1to see stalereference counts (retval error 2).
Fix: Commit efad162f5a84 ("selftests/bpf: Fix map_kptr test failure") added a
count_refBPF program andwait_for_map_release()that polls until thereference count drops to 2, rather than relying on a single
kern_sync_rcu()call.
Both fixes are confirmed present in the current tree:
2669dde7a8c6(2026-02-11): tools/testing/selftests/bpf/progs/rcu_tasks_trace_gp.c,tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
efad162f5a84(2026-01-15): tools/testing/selftests/bpf/prog_tests/map_kptr.c,tools/testing/selftests/bpf/progs/map_kptr.c
Proposed Fix
Remove the
map_kptrline from both CI DENYLIST files:kernel-patches/vmtest: ci/vmtest/configs/DENYLISTlibbpf/ci: ci/vmtest/configs/DENYLISTNo in-tree kernel changes needed — the test code is already fixed.
Impact
The
map_kptrtest exercises critical BPF functionality:With the test denylisted, regressions in any of these areas would go undetected
by CI.
References