函数逻辑报告 |
Source Code:kernel\bpf\verifier.c |
Create Date:2022-07-27 14:10:54 |
Last Modify:2022-05-19 20:02:10 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__mark_chain_precision
函数原型:static int __mark_chain_precision(struct bpf_verifier_env *env, int regno, int spi)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct bpf_verifier_env * | env | |
int | regno | |
int | spi |
1730 | st等于current verifier state |
1736 | stack_mask等于如果spi大于等于0则1ull左移spi位否则0 |
1737 | bool skip_first = true |
1738 | bool new_marks = false |
1741 | 如果非allow_ptr_leaks则返回:0 |
1745 | func等于 call stack tracking [curframe] |
1746 | 如果regno大于等于0则 |
1752 | 如果非 if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety 则new_marks = true |
1754 | 否则reg_mask等于0 |
1760 | 如果slot_type[0]不等于 register spilled into stack 则 |
1761 | stack_mask等于0 |
1762 | 退出 |
1764 | reg等于spilled_ptr |
1766 | stack_mask等于0 |
1767 | 退出 |
1769 | 如果非 if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety 则new_marks = true |
1771 | 否则stack_mask等于0 |
1774 | 退出 |
1777 | 如果非new_marks则返回:0 |
1779 | 如果非reg_mask且非stack_mask则返回:0 |
1781 | 循环 |
1782 | DECLARE_BITMAP(mask, 64) |
1783 | history等于jmp_history_cnt |
1787 | 循环 |
1788 | 如果skip_first则 |
1789 | err等于0 |
1790 | skip_first = false |
1791 | 否则 |
1794 | 如果err恒等于负Operation is not supported 则 |
1797 | 否则如果err则 |
1798 | 返回:err |
1800 | 如果非reg_mask且非stack_mask则返回:0 |
1808 | i等于Backtrack one insn at a time. If idx is not at the top of recorded* history then previous instruction came from straight line execution. |
1809 | 如果i大于等于 Number of filter blocks 则 |
1825 | new_marks = false |
1826 | func等于 call stack tracking [curframe] |
1834 | 如果非 if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety 则new_marks = true |
1841 | 如果i大于等于allocated_stack除size of eBPF register in bytes 则 |
1859 | 如果slot_type[0]不等于 register spilled into stack 则 |
1860 | stack_mask与等于1ull左移i位的值的反 |
1861 | 继续下一循环 |
1863 | reg等于spilled_ptr |
1865 | stack_mask与等于1ull左移i位的值的反 |
1866 | 继续下一循环 |
1868 | 如果非 if (!precise && SCALAR_VALUE) min/max/tnum don't affect safety 则new_marks = true |
1872 | 如果level按位与BPF_LOG_LEVEL则 |
1873 | print_verifier_state(env, func) |
1874 | verbose(env, "parent %s regs=%x stack=%llx marks\n", new_marks ? "didn't have" : "already had", reg_mask, stack_mask) |
1879 | 如果非reg_mask且非stack_mask则退出 |
1884 | last_idx等于last_insn_idx |
1887 | 返回:0 |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |