Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 12:56:51 |
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:check_subprogs
Proto:static int check_subprogs(struct bpf_verifier_env *env)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct bpf_verifier_env * | env |
| 1190 | cur_subprog = 0 |
| 1191 | subprog = subprog_info |
| 1193 | insn_cnt = Number of filter blocks |
| 1196 | ret = add_subprog(env, 0) |
| 1202 | If opcode != (BPF_JMP | unction call ) Then Continue |
| 1204 | If source register != when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative* offset to another bpf function Then Continue |
| 1206 | If Not allow_ptr_leaks Then |
| 1208 | Return -EPERM |
| 1210 | ret = add_subprog(env, i + signed immediate constant + 1) |
| 1220 | If level & BPF_LOG_LEVEL2 Then When i < subprog_cnt cycle |
| 1222 | verbose(env, "func#%d @%d\n", i, insn idx of function entry point ) |
| 1230 | If Instruction classes (code) != BPF_JMP && Instruction classes (code) != jmp mode in word width Then Go to next |
| 1232 | If alu/jmp fields (code) == unction return || alu/jmp fields (code) == unction call Then Go to next |
| 1234 | off = i + signed offset + 1 |
| 1235 | If off < subprog_start || off >= subprog_end Then |
| 1239 | next : |
| 1240 | If i == subprog_end - 1 Then |
| 1250 | subprog_start = subprog_end |
| 1251 | cur_subprog++ |
| 1252 | If cur_subprog < subprog_cnt Then subprog_end = insn idx of function entry point |
| 1256 | Return 0 |
| Name | Describe |
|---|---|
| bpf_check |
| 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 |