Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:btf_parse_hdr

Proto:static int btf_parse_hdr(struct btf_verifier_env *env)

Type:int

Parameter:

TypeParameterName
struct btf_verifier_env *env
3298  btf = btf
3299  btf_data_size = data_size
3301  If btf_data_size < offsetof(structbtf_header, hdr_len) + size of hdr_len Then
3303  btf_verifier_log(env, "hdr_len not found")
3304  Return -EINVAL
3307  hdr = data
3308  hdr_len = hdr_len
3309  If btf_data_size < hdr_len Then
3310  btf_verifier_log(env, "btf_header not found")
3311  Return -EINVAL
3315  If hdr_len > size of hdr Then
3316  expected_zero = data + size of hdr
3317  end = data + hdr_len
3319  When expected_zero < end cycle
3320  If expected_zero Then
3321  btf_verifier_log(env, "Unsupported btf_header")
3322  Return -E2BIG
3327  hdr_copy = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, hdr_len, size of hdr )
3328  No 3D Now!( & hdr, data, hdr_copy)
3330  hdr = hdr
3332  btf_verifier_log_hdr(env, btf_data_size)
3334  If magic != BTF_MAGIC Then
3335  btf_verifier_log(env, "Invalid magic")
3336  Return -EINVAL
3339  If version != BTF_VERSION Then
3340  btf_verifier_log(env, "Unsupported version")
3341  Return -Operation is not supported
3344  If flags Then
3345  btf_verifier_log(env, "Unsupported flags")
3346  Return -Operation is not supported
3349  If btf_data_size == hdr_len Then
3350  btf_verifier_log(env, "No data")
3351  Return -EINVAL
3354  err = btf_check_sec_info(env, btf_data_size)
3355  If err Then Return err
3358  Return 0
Caller
NameDescribe
btf_parse
btf_parse_vmlinux