函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\btf.c Create Date:2022-07-27 14:36:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:btf_struct_check_meta

函数原型:static s32 btf_struct_check_meta(struct btf_verifier_env *env, const struct btf_type *t, u32 meta_left)

返回类型:s32

参数:

类型参数名称
struct btf_verifier_env *env
const struct btf_type *t
u32meta_left
2134  is_union等于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)恒等于Union
2137  btf等于btf
2138  struct_size等于size
2142  meta_needed等于btf_type_vlen(t)乘member的长度
2143  如果meta_left小于meta_needed
2144  btf_verifier_log_basic(env, t, "meta_left:%u meta_needed:%u", meta_left, meta_needed)
2147  返回:负EINVAL
2151  如果name_off且非Only C-style identifier is permitted. This can be relaxed if* necessary.
2153  btf_verifier_log_type(env, t, "Invalid name")
2154  返回:负EINVAL
2157  btf_verifier_log_type(env, t, NULL)
2159  last_offset等于0
2161  如果非btf_name_offset_valid(btf, name_off)则
2162  btf_verifier_log_member(env, t, member, "Invalid member name_offset:%u", name_off)
2165  返回:负EINVAL
2169  如果name_off且非Only C-style identifier is permitted. This can be relaxed if* necessary.
2171  btf_verifier_log_member(env, t, member, "Invalid name")
2172  返回:负EINVAL
2175  如果非type或非BTF_TYPE_ID_VALID(type)则
2176  btf_verifier_log_member(env, t, member, "Invalid type_id")
2178  返回:负EINVAL
2181  offset等于btf_member_bit_offset(t, member)
2182  如果is_unionoffset
2183  btf_verifier_log_member(env, t, member, "Invalid member bits_offset")
2185  返回:负EINVAL
2192  如果last_offset大于offset
2193  btf_verifier_log_member(env, t, member, "Invalid member bits_offset")
2195  返回:负EINVAL
2198  如果BITS_ROUNDUP_BYTES(offset)大于struct_size
2199  btf_verifier_log_member(env, t, member, "Member bits_offset exceeds its struct size")
2201  返回:负EINVAL
2204  btf_verifier_log_member(env, t, member, NULL)
2205  last_offset等于offset
2208  返回:meta_needed