linux/tools/include/uapi
Alexei Starovoitov a7658e1a41 bpf: Check types of arguments passed into helpers
Introduce new helper that reuses existing skb perf_event output
implementation, but can be called from raw_tracepoint programs
that receive 'struct sk_buff *' as tracepoint argument or
can walk other kernel data structures to skb pointer.

In order to do that teach verifier to resolve true C types
of bpf helpers into in-kernel BTF ids.
The type of kernel pointer passed by raw tracepoint into bpf
program will be tracked by the verifier all the way until
it's passed into helper function.
For example:
kfree_skb() kernel function calls trace_kfree_skb(skb, loc);
bpf programs receives that skb pointer and may eventually
pass it into bpf_skb_output() bpf helper which in-kernel is
implemented via bpf_skb_event_output() kernel function.
Its first argument in the kernel is 'struct sk_buff *'.
The verifier makes sure that types match all the way.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191016032505.2089704-11-ast@kernel.org
2019-10-17 16:44:36 +02:00
..
asm tools headers: Fixup bitsperlong per arch includes 2019-08-20 12:23:00 -03:00
asm-generic tools uapi asm-generic: Sync unistd.h with the kernel sources 2019-09-20 14:59:28 -03:00
drm tools headers UAPI: Update tools's copy of drm.h headers 2019-07-29 09:03:42 -03:00
linux bpf: Check types of arguments passed into helpers 2019-10-17 16:44:36 +02:00
sound tools include uapi: Sync sound/asound.h copy 2019-04-16 12:36:20 -03:00