函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\verifier.c Create Date:2022-07-27 14:18:50
Last Modify:2022-05-19 20:02:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:bpf_patch_insn_data

函数原型:static struct bpf_prog *bpf_patch_insn_data(struct bpf_verifier_env *env, u32 off, const struct bpf_insn *patch, u32 len)

返回类型:struct bpf_prog

参数:

类型参数名称
struct bpf_verifier_env *env
u32off
const struct bpf_insn *patch
u32len
8391  new_prog等于bpf_patch_insn_single(BPF program being verified , off, patch, len)
8392  如果是错误
8393  如果错误恒等于负ERANGEverbose(env, "insn %d cannot be patched due to 16-bit range\n", original instruction index )
8397  返回:NULL
8399  如果single env->prog->insni[off] instruction was replaced with the range* insni[off, off + cnt). Adjust corresponding insn_aux_data by copying* [0, off) and [off, end) to new locations, so the patched range stays zero则返回:NULL
8401  adjust_subprog_starts(env, off, len)
8402  返回:new_prog
调用者
名称描述
opt_subreg_zext_lo32_rnd_hi32
convert_ctx_accessesvert load instructions that access fields of a context type into a* sequence of instructions that access fields of the underlying structure:* struct __sk_buff -> struct sk_buff* struct bpf_sock_ops -> struct sock
fixup_bpf_callsxup insn->imm field of bpf_call instructions* and inline eligible helpers as explicit sequence of BPF instructions* this function is called after eBPF program passed verification