Fix for a bug in prealloc_lru_pop spotted while reading the code, then a test + example that checks whether it is fixed. Changelog: ---------- v2 -> v3: v2: https://lore.kernel.org/bpf/20220809140615.21231-1-memxor@xxxxxxxxx * Switch test to use kptr instead of kptr_ref to stabilize test runs * Fix missing lru_bug__destroy (Yonghong) * Collect Acks v1 -> v2: v1: https://lore.kernel.org/bpf/20220806014603.1771-1-memxor@xxxxxxxxx * Expand commit log to include summary of the discussion with Yonghong * Make lru_bug selftest serial to not mess up refcount for map_kptr test Kumar Kartikeya Dwivedi (3): bpf: Allow calling bpf_prog_test kfuncs in tracing programs bpf: Don't reinit map value in prealloc_lru_pop selftests/bpf: Add test for prealloc_lru_pop bug kernel/bpf/hashtab.c | 6 +-- net/bpf/test_run.c | 1 + .../selftests/bpf/prog_tests/lru_bug.c | 21 ++++++++ tools/testing/selftests/bpf/progs/lru_bug.c | 49 +++++++++++++++++++ 4 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/lru_bug.c create mode 100644 tools/testing/selftests/bpf/progs/lru_bug.c -- 2.34.1