selftests/bpf: Add test passing MAYBE_NULL reg to bpf_refcount_acquire
authorDave Marchevsky <davemarchevsky@fb.com>
Tue, 7 Nov 2023 08:56:35 +0000 (00:56 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Nov 2023 03:07:51 +0000 (19:07 -0800)
commitf460e7bdb027d1da93f0c5090b239889cd46a33d
tree463f36a4f1d9048c1710da3fe469a9dda318ae32
parent1500a5d9f49cb66906d3ea1c9158df25cc41dd40
selftests/bpf: Add test passing MAYBE_NULL reg to bpf_refcount_acquire

The test added in this patch exercises the logic fixed in the previous
patch in this series. Before the previous patch's changes,
bpf_refcount_acquire accepts MAYBE_NULL local kptrs; after the change
the verifier correctly rejects the such a call.

Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Link: https://lore.kernel.org/r/20231107085639.3016113-3-davemarchevsky@fb.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c