Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:btf_int_check_meta

Proto:static s32 btf_int_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
1325  meta_needed = size of int_data
1328  If meta_left < meta_needed Then
1329  btf_verifier_log_basic(env, t, "meta_left:%u meta_needed:%u", meta_left, meta_needed)
1332  Return -EINVAL
1335  If btf_type_vlen(t) Then
1336  btf_verifier_log_type(env, t, "vlen != 0")
1337  Return -EINVAL
1340  If btf_type_kflag(t) Then
1341  btf_verifier_log_type(env, t, "Invalid btf_info kind_flag")
1342  Return -EINVAL
1345  int_data = btf_type_int(t)
1346  If int_data & ~BTF_INT_MASK Then
1347  btf_verifier_log_basic(env, t, "Invalid int_data:%x", int_data)
1349  Return -EINVAL
1352  nr_bits = BTF_INT_BITS(int_data) + BTF_INT_OFFSET(int_data)
1354  If nr_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, Then
1355  btf_verifier_log_type(env, t, "nr_bits exceeds %zu", 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,)
1357  Return -EINVAL
1360  If BITS_ROUNDUP_BYTES(nr_bits) > size Then
1361  btf_verifier_log_type(env, t, "nr_bits exceeds type_size")
1362  Return -EINVAL
1371  encoding = BTF_KIND_INT is followed by a u32 and the following* is the 32 bits arrangement:(int_data)
1372  If encoding && encoding != Attributes stored in the BTF_INT_ENCODING && encoding != BTF_INT_CHAR && encoding != BTF_INT_BOOL Then
1376  btf_verifier_log_type(env, t, "Unsupported encoding")
1377  Return -Operation is not supported
1380  btf_verifier_log_type(env, t, NULL)
1382  Return meta_needed