diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-09-21 15:00:41 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-21 15:05:09 -0700 |
commit | 4153b89b41265a4b35820deb58b92a6c52bd805a (patch) | |
tree | 7ea295685ddd54b775cdc688bcfe0b5f577e48f6 /tools/testing/selftests/bpf/progs/test_d_path.c | |
parent | 31f23a6a181c81543b10a1a9056b0e6c7ef1c747 (diff) | |
parent | f79e7ea571732a6e16f15c6e2f000c347e2d7431 (diff) |
Merge branch 'refactor-check_func_arg'
Lorenz Bauer says:
====================
Changes in v4:
- Output the desired type on BTF ID mismatch (Martin)
Changes in v3:
- Fix BTF_ID_LIST_SINGLE if BTF is disabled (Martin)
- Drop incorrect arg_btf_id in bpf_sk_storage.c (Martin)
- Check for arg_btf_id in check_func_proto (Martin)
- Drop incorrect PTR_TO_BTF_ID from fullsock_types (Martin)
- Introduce btf_seq_file_ids in bpf_trace.c to reduce duplication
Changes in v2:
- Make the series stand alone (Martin)
- Drop incorrect BTF_SET_START fix (Andrii)
- Only support a single BTF ID per argument (Martin)
- Introduce BTF_ID_LIST_SINGLE macro (Andrii)
- Skip check_ctx_reg iff register is NULL
- Change output of check_reg_type slightly, to avoid touching tests
Original cover letter:
Currently, check_func_arg has this pretty gnarly if statement that
compares the valid arg_type with the actualy reg_type. Sprinkled
in-between are checks for register_is_null, to short circuit these
tests if we're dealing with a nullable arg_type. There is also some
code for later bounds / access checking hidden away in there.
This series of patches refactors the function into something like this:
if (reg_is_null && arg_type_is_nullable)
skip type checking
do type checking, including BTF validation
do bounds / access checking
The type checking is now table driven, which makes it easy to extend
the acceptable types. Maybe more importantly, using a table makes it
easy to provide more helpful verifier output (see the last patch).
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_d_path.c')
0 files changed, 0 insertions, 0 deletions