diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2019-04-09 23:20:09 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-09 17:05:46 -0700 |
commit | 1dc92851849cc2235a1efef8f8d5a9255efc5f13 (patch) | |
tree | 9e1de91732e04a14dfcf5cec8398c257a1f7ff27 /kernel/configs | |
parent | f063c889c9458354a92b235a51cbb60d30321070 (diff) | |
download | linux-1dc92851849cc2235a1efef8f8d5a9255efc5f13.tar.bz2 |
bpf: kernel side support for BTF Var and DataSec
This work adds kernel-side verification, logging and seq_show dumping
of BTF Var and DataSec kinds which are emitted with latest LLVM. The
following constraints apply:
BTF Var must have:
- Its kind_flag is 0
- Its vlen is 0
- Must point to a valid type
- Type must not resolve to a forward type
- Size of underlying type must be > 0
- Must have a valid name
- Can only be a source type, not sink or intermediate one
- Name may include dots (e.g. in case of static variables
inside functions)
- Cannot be a member of a struct/union
- Linkage so far can either only be static or global/allocated
BTF DataSec must have:
- Its kind_flag is 0
- Its vlen cannot be 0
- Its size cannot be 0
- Must have a valid name
- Can only be a source type, not sink or intermediate one
- Name may include dots (e.g. to represent .bss, .data, .rodata etc)
- Cannot be a member of a struct/union
- Inner btf_var_secinfo array with {type,offset,size} triple
must be sorted by offset in ascending order
- Type must always point to BTF Var
- BTF resolved size of Var must be <= size provided by triple
- DataSec size must be >= sum of triple sizes (thus holes
are allowed)
btf_var_resolve(), btf_ptr_resolve() and btf_modifier_resolve()
are on a high level quite similar but each come with slight,
subtle differences. They could potentially be a bit refactored
in future which hasn't been done here to ease review.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/configs')
0 files changed, 0 insertions, 0 deletions