Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:btf_datasec_check_meta

Proto:static s32 btf_datasec_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
2717  last_vsi_end_off = 0 , sum = 0
2720  meta_needed = btf_type_vlen(t) * size of vsi
2721  If meta_left < meta_needed Then
2722  btf_verifier_log_basic(env, t, "meta_left:%u meta_needed:%u", meta_left, meta_needed)
2725  Return -EINVAL
2728  If Not btf_type_vlen(t) Then
2729  btf_verifier_log_type(env, t, "vlen == 0")
2730  Return -EINVAL
2733  If Not size Then
2734  btf_verifier_log_type(env, t, "size == 0")
2735  Return -EINVAL
2738  If btf_type_kflag(t) Then
2739  btf_verifier_log_type(env, t, "Invalid btf_info kind_flag")
2740  Return -EINVAL
2743  If Not name_off || Not btf_name_valid_section(btf, name_off) Then
2745  btf_verifier_log_type(env, t, "Invalid name")
2746  Return -EINVAL
2749  btf_verifier_log_type(env, t, NULL)
2753  If Not type || Not BTF_TYPE_ID_VALID(type) Then
2754  btf_verifier_log_vsi(env, t, vsi, "Invalid type_id")
2756  Return -EINVAL
2759  If offset < last_vsi_end_off || offset >= size Then
2760  btf_verifier_log_vsi(env, t, vsi, "Invalid offset")
2762  Return -EINVAL
2765  If Not size || size > size Then
2766  btf_verifier_log_vsi(env, t, vsi, "Invalid size")
2768  Return -EINVAL
2771  last_vsi_end_off = offset + size
2772  If last_vsi_end_off > size Then
2773  btf_verifier_log_vsi(env, t, vsi, "Invalid offset+size")
2775  Return -EINVAL
2778  btf_verifier_log_vsi(env, t, vsi, NULL)
2779  sum += size
2782  If size < sum Then
2783  btf_verifier_log_type(env, t, "Invalid btf_info size")
2784  Return -EINVAL
2787  Return meta_needed