summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2026-09-04 12:41:53 +0200
committerAlexei Starovoitov <ast@kernel.org>2026-09-04 12:24:24 -0700
commitdbf6806dc81553edbab72fcec9a6d637dedff2f4 (patch)
treed7a697d4afd93b07d0b85168ac62792089556446 /scripts
parent5df46ddcb7b36878c1b691e9057a0509042a2567 (diff)
downloadlinux-dbf6806dc81553edbab72fcec9a6d637dedff2f4.tar.gz
linux-dbf6806dc81553edbab72fcec9a6d637dedff2f4.zip
selftests/bpf: Test timer field on recycled rhtab element
Exercise the rhtab special-field lifecycle with the sequence from the original report. A bpf_for_each_map_elem() callback deletes the sole element, then initializes and arms a timer through the callback value pointer while it remains valid. Use a one-element map and pin userspace and BPF execution to one CPU. Repeated delete-and-replace cycles drain the per-CPU allocator cache, and periodic RCU synchronization makes the deleted units available for recycling. After each replacement, a second BPF program calls bpf_timer_cancel() on its value. A successful cancellation proves both that a timer-bearing unit was recycled and that insertion preserved the timer field. Without the fix, insertion clears that field and cancellation keeps returning -EINVAL. A long expiration keeps the timer callback out of the test, so the regression is detected without accessing freed memory. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20260904104203.345917-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions