selftests/bpf: Add tests for kfunc register offset checks
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Fri, 4 Mar 2022 22:46:45 +0000 (04:16 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 5 Mar 2022 23:29:36 +0000 (15:29 -0800)
commit8218ccb5bd68976ed5d75028ef50c13a857eee25
treef0b594982bfae3c0e046bcca8e4a9313fc0d35dc
parent0b206c6d1066f1ee85e4238a1e34d7437148a9a3
selftests/bpf: Add tests for kfunc register offset checks

Include a few verifier selftests that test against the problems being
fixed by previous commits, i.e. release kfunc always require
PTR_TO_BTF_ID fixed and var_off to be 0, and negative offset is not
permitted and returns a helpful error message.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20220304224645.3677453-9-memxor@gmail.com
net/bpf/test_run.c
tools/testing/selftests/bpf/verifier/calls.c