Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\verifier.c Create Date:2022-07-28 13:04:10
Last Modify:2022-05-19 20:02:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bpf_patch_insn_data

Proto:static struct bpf_prog *bpf_patch_insn_data(struct bpf_verifier_env *env, u32 off, const struct bpf_insn *patch, u32 len)

Type:struct bpf_prog

Parameter:

TypeParameterName
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  If IS_ERR(new_prog) Then
8393  If PTR_ERR(new_prog) == -ERANGE Then verbose(env, "insn %d cannot be patched due to 16-bit range\n", original instruction index )
8397  Return NULL
8399  If 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 Then Return NULL
8401  adjust_subprog_starts(env, off, len)
8402  Return new_prog
Caller
NameDescribe
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