Re: [PATCH bpf-next v2 5/9] selftests/bpf: Add kfunc __arena and __arena_nullable argument tests

"Kumar Kartikeya Dwivedi" <[email protected]>
Newsgroups dev.linux.lists.sashiko-reviews,org.kernel.vger.bpf
Message-ID <[email protected]>
On Sun Jul 26, 2026 at 3:41 AM CEST, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The `arena_arg_stack` failure test is conditionally compiled out on compilers missing `__BPF_FEATURE_ADDR_SPACE_CAST`, causing a false test suite failure.
> --
>
> --- Patch [5]: [PATCH bpf-next v2 5/9] selftests/bpf: Add kfunc __arena and __arena_nullable argument tests ---
> commit b7abeb2e41481276f90bb3144448d08e3c6e2c96
> Author: Tejun Heo <[email protected]>
>
> selftests/bpf: Add kfunc __arena and __arena_nullable argument tests
>
> This commit adds kfunc arena argument tests to bpf_testmod to exercise
> argument rebasing, various accepted argument forms, and verifier rejections.
>
>> diff --git a/tools/testing/selftests/bpf/progs/arena_kfunc.c b/tools/testing/selftests/bpf/progs/arena_kfunc.c
>> new file mode 100644
>> index 0000000000000..e7250c5197ab4
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/progs/arena_kfunc.c
>
> [ ... ]
>
>> +SEC("syscall")
>> +__arch_x86_64
>> +__failure __msg("arena pointer cannot be a stack argument")
>> +int arena_arg_stack(void *ctx)
>> +{
>> +#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
>> +	bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
>> +	bpf_kfunc_arena_stack_arg_test(1, 2, 3, 4, 5, (u64 *)1);
>> +#endif
>> +	return 0;
>> +}
>
> [Severity: Medium]
> Does this conditional compilation cause the test suite to fail on older
> compilers missing __BPF_FEATURE_ADDR_SPACE_CAST?
>
> Because this test is marked with __failure, the test runner expects the
> verifier to reject it. If the macro is not defined, the program compiles
> to just return 0. The verifier will successfully load the empty program,
> causing the test runner to report a failure because the expected rejection
> did not occur.

I think the goal is to not fail compilation, this is fine as a tradeoff.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.