Function report |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-28 13:02:20 |
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:, w, e - match pseudo-code above:
Proto:static int push_insn(int t, int w, int e, struct bpf_verifier_env *env, bool loop_ok)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| int | t | index of current instruction |
| int | w | next instruction |
| int | e | edge |
| struct bpf_verifier_env * | env | |
| bool | loop_ok |
| 6489 | insn_stack = insn_stack |
| 6490 | insn_state = insn_state |
| 6492 | If edge == FALLTHROUGH && insn_state[ index of current instruction] >= (DISCOVERED | FALLTHROUGH) Then Return 0 |
| 6495 | If edge == BRANCH && insn_state[ index of current instruction] >= (DISCOVERED | BRANCH) Then Return 0 |
| 6498 | If next instruction < 0 || next instruction >= Number of filter blocks Then |
| 6499 | verbose_linfo(env, index of current instruction, "%d: ", index of current instruction) |
| 6500 | verbose(env, "jump out of range from insn %d to %d\n", index of current instruction, next instruction) |
| 6501 | Return -EINVAL |
| 6504 | If edge == BRANCH Then init_explored_state(env, next instruction) |
| 6508 | If insn_state[ next instruction] == 0 Then |
| 6510 | insn_state[ index of current instruction] = DISCOVERED | edge |
| 6511 | insn_state[ next instruction] = DISCOVERED |
| 6512 | If cur_stack >= Number of filter blocks Then Return -E2BIG |
| 6514 | insn_stack[cur_stack++] = next instruction |
| 6515 | Return 1 |
| 6516 | Else if (insn_state[ next instruction] & 0xF0) == DISCOVERED Then |
| 6517 | If loop_ok && allow_ptr_leaks Then Return 0 |
| 6519 | verbose_linfo(env, index of current instruction, "%d: ", index of current instruction) |
| 6520 | verbose_linfo(env, next instruction, "%d: ", next instruction) |
| 6521 | verbose(env, "back-edge from insn %d to %d\n", index of current instruction, next instruction) |
| 6522 | Return -EINVAL |
| 6523 | Else if insn_state[ next instruction] == EXPLORED Then |
| 6525 | insn_state[ index of current instruction] = DISCOVERED | edge |
| 6526 | Else |
| 6530 | Return 0 |
| Name | Describe |
|---|---|
| check_cfg | -recursive depth-first-search to detect loops in BPF program* loop == back-edge in directed graph |
| 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 |