Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:btf_check_meta

Proto:static s32 btf_check_meta(struct btf_verifier_env *env, const struct btf_type *t, u32 meta_left)

Type:s32

Parameter:

TypeParameterName
struct btf_verifier_env *env
const struct btf_type *t
u32meta_left
3003  saved_meta_left = meta_left
3006  If meta_left < size of t Then
3007  btf_verifier_log(env, "[%u] meta_left:%u meta_needed:%zu", log_type_id, meta_left, size of t )
3009  Return -EINVAL
3011  meta_left -= size of t
3013  If "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd & ~BTF_INFO_MASK Then
3014  btf_verifier_log(env, "[%u] Invalid btf_info:%x", log_type_id, "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)
3016  Return -EINVAL
3019  If BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd) > BTF_KIND_MAX || BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd) == Unknown Then
3021  btf_verifier_log(env, "[%u] Invalid kind:%u", log_type_id, BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd))
3023  Return -EINVAL
3026  If Not btf_name_offset_valid(btf, name_off) Then
3027  btf_verifier_log(env, "[%u] Invalid name_offset:%u", log_type_id, name_off)
3029  Return -EINVAL
3032  var_meta_size = check_meta(env, t, meta_left)
3033  If var_meta_size < 0 Then Return var_meta_size
3036  meta_left -= var_meta_size
3038  Return saved_meta_left - meta_left
Caller
NameDescribe
btf_check_all_metas