]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Test modified syscall ctx for ARG_PTR_TO_CTX
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Mon, 6 Apr 2026 19:43:59 +0000 (21:43 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 6 Apr 2026 22:27:27 +0000 (15:27 -0700)
commit02c68b10d84f133b88ebf160de49cb3fa4290d97
tree1d8813f00ec42755baa695933b717ff95eb2c859
parent5a34139b273272af2badcb695931493ed400befc
selftests/bpf: Test modified syscall ctx for ARG_PTR_TO_CTX

Ensure that global subprogs and tail calls can only accept an unmodified
PTR_TO_CTX for syscall programs. For all other program types, fixed or
variable offsets on PTR_TO_CTX is rejected when passed into an argument
of any call instruction type, through the unified logic of
check_func_arg_reg_off.

Finally, add a positive example of a case that should succeed with all
our previous changes.

Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Acked-by: Puranjay Mohan <puranjay@kernel.org>
Acked-by: Mykyta Yatsenko <yatsenko@meta.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260406194403.1649608-6-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/verifier_global_subprogs.c