]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests/bpf: add positive tests for new VFS based BPF kfuncs
authorMatt Bobrowski <mattbobrowski@google.com>
Wed, 31 Jul 2024 11:08:33 +0000 (11:08 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 6 Aug 2024 16:01:42 +0000 (09:01 -0700)
commit2b399b9b1f995d71f53e94a41e5717db46c39459
tree64abe593d79ffc6b01fdb2a4ff40fb5d3cb33a54
parentff358ada070fa1b64a6368147b2b56cc6a921847
selftests/bpf: add positive tests for new VFS based BPF kfuncs

Add a bunch of positive selftests which extensively cover the various
contexts and parameters in which the new VFS based BPF kfuncs may be
used from.

Again, the following VFS based BPF kfuncs are thoroughly tested within
this new selftest:
* struct file *bpf_get_task_exe_file(struct task_struct *);
* void bpf_put_file(struct file *);
* int bpf_path_d_path(struct path *, char *, size_t);

Acked-by: Christian Brauner <brauner@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://lore.kernel.org/r/20240731110833.1834742-4-mattbobrowski@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/verifier.c
tools/testing/selftests/bpf/progs/verifier_vfs_accept.c [new file with mode: 0644]