]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: bpf: Fix test_bpf_nf for trusted args becoming default
authorPuranjay Mohan <puranjay@kernel.org>
Fri, 2 Jan 2026 18:00:36 +0000 (10:00 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 2 Jan 2026 20:04:29 +0000 (12:04 -0800)
commitcf503eb2c6c38bf449063f33790a96218a067718
tree1299f3e7828d224cc3d5b3309afe7a2197d75b00
parentcf82580c86a91de2aa979260985cadcb39ed28d2
selftests: bpf: Fix test_bpf_nf for trusted args becoming default

With trusted args now being the default, passing NULL to kfunc
parameters that are pointers causes verifier rejection rather than a
runtime error. The test_bpf_nf test was failing because it attempted to
pass NULL to bpf_xdp_ct_lookup() to verify runtime error handling.

Since the NULL check now happens at verification time, remove the
runtime test case that passed NULL to the bpf_tuple parameter and
instead add verification-time tests to ensure the verifier correctly
rejects programs that pass NULL to trusted arguments.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Link: https://lore.kernel.org/r/20260102180038.2708325-11-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_nf.c
tools/testing/selftests/bpf/progs/test_bpf_nf.c
tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c