Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 13:02:44 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:check_btf_line
Proto:static int check_btf_line(struct bpf_verifier_env *env, const union bpf_attr *attr, union bpf_attr __user *uattr)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct bpf_verifier_env * | env | |
const union bpf_attr * | attr | |
union bpf_attr __user * | uattr |
6794 | prev_offset = 0 |
6803 | If Not nr_linfo Then Return 0 |
6807 | If rec_size < MIN_BPF_LINEINFO_SIZE || rec_size > MAX_LINEINFO_REC_SIZE || rec_size & sizeof(u32) - 1 Then Return -EINVAL |
6820 | prog = BPF program being verified |
6823 | s = 0 |
6824 | sub = subprog_info |
6825 | ulinfo = u64_to_user_ptr(line_info) |
6826 | expected_size = sizeof(structbpf_line_info) |
6827 | ncopy = min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, expected_size, rec_size) |
6830 | If err Then |
6833 | If Write a simple value into user space(expected_size, & userspace bpf_line_info size ) Then err = -EFAULT |
6837 | Go to err_free |
6840 | If copy_from_user( & linfo[i], ulinfo, ncopy) Then |
6856 | If i && insn_off <= prev_offset || insn_off >= Number of filter blocks Then |
6858 | verbose(env, "Invalid line_info[%u].insn_off:%u (prev_offset:%u prog->len:%u)\n", i, insn_off, prev_offset, Number of filter blocks ) |
6862 | Go to err_free |
6865 | If Not opcode Then |
6870 | Go to err_free |
6873 | If Not btf_name_by_offset(btf, line_off) || Not btf_name_by_offset(btf, file_name_off) Then |
6877 | Go to err_free |
6880 | If s != subprog_cnt Then |
6881 | If insn_off == insn idx of function entry point Then |
6883 | s++ |
6884 | Else if insn idx of function entry point < insn_off Then |
6891 | prev_offset = insn_off |
6895 | If s != subprog_cnt Then |
6896 | verbose(env, "missing bpf_line_info for %u funcs starting from func#%u\n", subprog_cnt - s, s) |
6899 | Go to err_free |
6905 | Return 0 |
6907 | err_free : |
6909 | Return err |
Name | Describe |
---|---|
check_btf_info |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |