Martin KaFai Lau 3820729160 bpf: Prepare btf_ctx_access for non raw_tp use case
This patch makes a few changes to btf_ctx_access() to prepare
it for non raw_tp use case where the attach_btf_id is not
necessary a BTF_KIND_TYPEDEF.

It moves the "btf_trace_" prefix check and typedef-follow logic to a new
function "check_attach_btf_id()" which is called only once during
bpf_check().  btf_ctx_access() only operates on a BTF_KIND_FUNC_PROTO
type now. That should also be more efficient since it is done only
one instead of every-time check_ctx_access() is called.

"check_attach_btf_id()" needs to find the func_proto type from
the attach_btf_id.  It needs to store the result into the
newly added prog->aux->attach_func_proto.  func_proto
btf type has no name, so a proper name should be stored into
"attach_func_name" also.

v2:
- Move the "btf_trace_" check to an earlier verifier phase (Alexei)

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191025001811.1718491-1-kafai@fb.com
2019-10-24 18:41:08 -07:00
..
2019-09-20 11:48:06 -07:00
2019-09-15 21:37:13 +02:00
2019-09-17 19:15:14 -07:00
2019-10-04 10:36:31 -07:00
2019-07-08 18:55:42 -07:00
2019-07-08 18:55:42 -07:00
2019-07-08 18:55:42 -07:00
2019-05-28 17:46:43 -04:00
2019-07-25 08:36:29 -07:00
2019-10-04 10:36:31 -07:00
2019-05-24 20:16:01 +02:00
2019-09-20 11:19:48 -07:00
2019-09-25 17:51:41 -07:00
2019-09-16 09:28:19 -07:00
2019-07-08 19:36:47 -07:00
2019-07-08 19:36:47 -07:00