Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\btf.c Create Date:2022-07-28 13:18:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:btf_array_resolve

Proto:static int btf_array_resolve(struct btf_verifier_env *env, const struct resolve_vertex *v)

Type:int

Parameter:

TypeParameterName
struct btf_verifier_env *env
const struct resolve_vertex *v
2001  array = btf_type_array(t)
2004  btf = btf
2008  index_type_id = index_type
2009  index_type = btf_type_by_id(btf, index_type_id)
2010  If btf_type_nosize_or_null(index_type) || Types that act only as a source, not sink or intermediate* type when resolving. Then
2012  btf_verifier_log_type(env, t, "Invalid index")
2013  Return -EINVAL
2016  If Not env_type_is_resolve_sink(env, index_type) && Not env_type_is_resolved(env, index_type_id) Then Return env_stack_push(env, index_type, index_type_id)
2020  index_type = btf_type_id_size(btf, & index_type_id, NULL)
2021  If Not index_type || Not btf_type_is_int(index_type) || Not Regular int is not a bit field and it must be either* u8/u16/u32/u64 or __int128. Then
2023  btf_verifier_log_type(env, t, "Invalid index")
2024  Return -EINVAL
2028  elem_type_id = type
2029  elem_type = btf_type_by_id(btf, elem_type_id)
2030  If btf_type_nosize_or_null(elem_type) || Types that act only as a source, not sink or intermediate* type when resolving. Then
2032  btf_verifier_log_type(env, t, "Invalid elem")
2034  Return -EINVAL
2037  If Not env_type_is_resolve_sink(env, elem_type) && Not env_type_is_resolved(env, elem_type_id) Then Return env_stack_push(env, elem_type, elem_type_id)
2041  elem_type = btf_type_id_size(btf, & elem_type_id, & elem_size)
2042  If Not elem_type Then
2043  btf_verifier_log_type(env, t, "Invalid elem")
2044  Return -EINVAL
2047  If btf_type_is_int(elem_type) && Not Regular int is not a bit field and it must be either* u8/u16/u32/u64 or __int128. Then
2048  btf_verifier_log_type(env, t, "Invalid array of int")
2049  Return -EINVAL
2052  If nelems && elem_size > U32_MAX / nelems Then
2053  btf_verifier_log_type(env, t, "Array size overflows U32_MAX")
2055  Return -EINVAL
2058  env_stack_pop_resolved(env, elem_type_id, elem_size * nelems)
2060  Return 0