diff options
author | Dave Marchevsky <davemarchevsky@fb.com> | 2022-12-01 10:34:06 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-12-01 19:38:17 -0800 |
commit | 78b037bd402df8eca0f45ef003c6d0ab25a26ecc (patch) | |
tree | 91ba7e8bf9f0f5956980f6e875a849a828eb3cd7 /tools/testing/selftests/bpf/prog_tests/bpf_loop.c | |
parent | 1f82dffc10ff8e44bd0c2c85ba6e21189b4a5695 (diff) |
selftests/bpf: Validate multiple ref release_on_unlock logic
Modify list_push_pop_multiple to alloc and insert nodes 2-at-a-time.
Without the previous patch's fix, this block of code:
bpf_spin_lock(lock);
bpf_list_push_front(head, &f[i]->node);
bpf_list_push_front(head, &f[i + 1]->node);
bpf_spin_unlock(lock);
would fail check_reference_leak check as release_on_unlock logic would miss
a ref that should've been released.
Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20221201183406.1203621-2-davemarchevsky@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_loop.c')
0 files changed, 0 insertions, 0 deletions