函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:btf_int_check_kflag_member

函数原型:static int btf_int_check_kflag_member(struct btf_verifier_env *env, const struct btf_type *struct_type, const struct btf_member *member, const struct btf_type *member_type)

返回类型:int

参数:

类型参数名称
struct btf_verifier_env *env
const struct btf_type *struct_type
const struct btf_member *member
const struct btf_type *member_type
1271  int_data等于btf_type_int(member_type)
1272  struct_size等于size
1276  如果非Regular int is not a bit field and it must be either* u8/u16/u32/u64 or __int128.
1277  btf_verifier_log_member(env, struct_type, member, "Invalid member base type")
1279  返回:负EINVAL
1283  nr_bits等于If the struct/union type info kind_flag is set, the* following two macros are used to access bitfield_size* and bit_offset from btf_member.offset.(If the type info kind_flag is set, the btf_member offset* contains both member bitfield size and bit offset. The* bitfield size is set for bitfield members. If the type* info kind_flag is not set, the offset contains only bit* offset.)
1284  struct_bits_off等于BTF_MEMBER_BIT_OFFSET(If the type info kind_flag is set, the btf_member offset* contains both member bitfield size and bit offset. The* bitfield size is set for bitfield members. If the type* info kind_flag is not set, the offset contains only bit* offset.)
1285  nr_int_data_bits等于BTF_INT_BITS(int_data)
1286  如果非nr_bits
1291  btf_verifier_log_member(env, struct_type, member, "Invalid member offset")
1293  返回:负EINVAL
1296  nr_bits等于nr_int_data_bits
1297  否则如果nr_bits大于nr_int_data_bits
1298  btf_verifier_log_member(env, struct_type, member, "Invalid member bitfield_size")
1300  返回:负EINVAL
1303  bytes_offset等于BITS_ROUNDDOWN_BYTES(struct_bits_off)
1304  nr_copy_bits等于nr_bitsBITS_PER_BYTE_MASKED(struct_bits_off)
1305  如果nr_copy_bits大于BTF verification:* To verify BTF data, two passes are needed.* Pass #1* ~~~~~~~* The first pass is to collect all btf_type objects to* an array: "btf->types".* Depending on the C type that a btf_type is describing,
1306  btf_verifier_log_member(env, struct_type, member, "nr_copy_bits exceeds 128")
1308  返回:负EINVAL
1311  如果struct_size小于bytes_offsetstruct_sizebytes_offset小于BITS_ROUNDUP_BYTES(nr_copy_bits)则
1313  btf_verifier_log_member(env, struct_type, member, "Member exceeds struct_size")
1315  返回:负EINVAL
1318  返回:0