函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:opt_subreg_zext_lo32_rnd_hi32

函数原型:static int opt_subreg_zext_lo32_rnd_hi32(struct bpf_verifier_env *env, const union bpf_attr *attr)

返回类型:int

参数:

类型参数名称
struct bpf_verifier_env *env
const union bpf_attr *attr
8666  struct bpf_insn * patch, zext_patch[2], rnd_hi32_patch[4]
8667  aux等于array of per-insn state
8668  delta等于0, len等于 Number of filter blocks
8669  insns等于insnsi
8673  rnd_hi32等于prog_flags按位与BPF_F_TEST_RND_HI32 is used in BPF_PROG_LOAD command for testing purpose.* Verifier does sub-register def/use analysis and identifies instructions whose* def only matters for low 32-bit, high 32-bit is never referenced later
8674  zext_patch[1]等于Special form of mov32, used for doing explicit zero extension on dst. (0)
8675  rnd_hi32_patch[1]等于ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 (mov reg to reg , Kernel hidden auxiliary/helper register. , 0)
8676  rnd_hi32_patch[2]等于ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 (BPF_LSH, Kernel hidden auxiliary/helper register. , 32)
8677  rnd_hi32_patch[3]等于ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg (BPF_OR, 0, Kernel hidden auxiliary/helper register. )
8678 i小于len循环
8679  adj_idx等于idelta
8682  insn等于insns[adj_idx]
8687  如果非rnd_hi32则继续下一循环
8690  code等于 opcode
8700  如果class恒等于BPF_LDBPF BPF_DW 0x18 64-bit (code)恒等于BPF_IMMi自加
8703  继续下一循环
8707  如果class恒等于BPF_LDX pointer type for load/store insns 恒等于g points to bpf_context 则继续下一循环
8711  imm_rnd等于get_random_int()
8712  rnd_hi32_patch[0]等于insn
8715  patch等于rnd_hi32_patch
8716  patch_len等于4
8717  转到:apply_patch_buffer
8720  如果非Return TRUE if the JIT backend wants verifier to enable sub-register usage* analysis code and wants explicit zero extension inserted by verifier.* Otherwise, return FALSE.则继续下一循环
8723  zext_patch[0]等于insn
8724  dest register 等于 dest register
8725  source register 等于 dest register
8726  patch等于zext_patch
8727  patch_len等于2
8728  apply_patch_buffer :
8729  new_prog等于bpf_patch_insn_data(env, adj_idx, patch, patch_len)
8730  如果非new_prog则返回:负ENOMEM
8732  BPF program being verified 等于new_prog
8733  insns等于insnsi
8734  aux等于array of per-insn state
8735  delta加等于patch_len减1
8738  返回:0
调用者
名称描述
bpf_check