]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Add test for zero offset or non-zero offset pointers as KF_ACQUIRE...
authorJuntong Deng <juntong.deng@outlook.com>
Wed, 28 Aug 2024 19:51:32 +0000 (20:51 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 29 Aug 2024 00:11:54 +0000 (17:11 -0700)
commit6db59c4935c9354f4c33fc63287d110317ca4d70
treeeac0dc2719f670ccec22d2e8eeeaaf703a6baa23
parentf633919d132cf1755d62278c989124c0ce23950f
selftests/bpf: Add test for zero offset or non-zero offset pointers as KF_ACQUIRE kfuncs argument

This patch adds test cases for zero offset (implicit cast) or non-zero
offset pointer as KF_ACQUIRE kfuncs argument. Currently KF_ACQUIRE
kfuncs should support passing in pointers like &sk->sk_write_queue
(non-zero offset) or &sk->__sk_common (zero offset) and not be rejected
by the verifier.

Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
Link: https://lore.kernel.org/r/AM6PR03MB5848CB6F0D4D9068669A905B99952@AM6PR03MB5848.eurprd03.prod.outlook.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod_kfunc.h
tools/testing/selftests/bpf/prog_tests/nested_trust.c
tools/testing/selftests/bpf/progs/nested_acquire.c [new file with mode: 0644]