Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:btf_check_sec_info

Proto:static int btf_check_sec_info(struct btf_verifier_env *env, u32 btf_data_size)

Type:int

Parameter:

TypeParameterName
struct btf_verifier_env *env
u32btf_data_size
3246  btf = btf
3247  hdr = hdr
3250  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(btf_sec_info_offset) cycle secs[i] = *(hdr + btf_sec_info_offset[i])
3254  sort(secs, ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(btf_sec_info_offset), sizeof(structbtf_sec_info), btf_sec_info_cmp, NULL)
3258  total = 0
3259  expected_total = btf_data_size - hdr_len
3260  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(btf_sec_info_offset) cycle
3261  If expected_total < off Then
3262  btf_verifier_log(env, "Invalid section offset")
3263  Return -EINVAL
3265  If total < off Then
3267  btf_verifier_log(env, "Unsupported section found")
3268  Return -EINVAL
3270  If total > off Then
3271  btf_verifier_log(env, "Section overlap found")
3272  Return -EINVAL
3274  If expected_total - total < len Then
3275  btf_verifier_log(env, "Total section length too long")
3277  Return -EINVAL
3279  total += len
3283  If expected_total != total Then
3284  btf_verifier_log(env, "Unsupported section found")
3285  Return -EINVAL
3288  Return 0
Caller
NameDescribe
btf_parse_hdr