]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: test cases for __arg_untrusted
authorEduard Zingerman <eddyz87@gmail.com>
Fri, 4 Jul 2025 23:03:52 +0000 (16:03 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 7 Jul 2025 15:25:07 +0000 (08:25 -0700)
commit54ac2c9418af2f115ca42419e6c6633b88f3d49d
treec862b54461c63e448461433894f68aa3de82d221
parentaaa0e57e693083b997f21064689710dfe98b326c
selftests/bpf: test cases for __arg_untrusted

Check usage of __arg_untrusted parameters with PTR_TO_BTF_ID:
- combining __arg_untrusted with other tags is forbidden;
- non-kernel (program local) types for __arg_untrusted are forbidden;
- passing of {trusted, untrusted, map value, scalar value, values with
  variable offset} to untrusted is ok;
- passing of PTR_TO_BTF_ID with a different type to untrusted is ok;
- passing of untrusted to trusted is forbidden.

Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20250704230354.1323244-7-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/verifier_global_ptr_args.c