Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:check_xadd

Proto:static int check_xadd(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn)

Type:int

Parameter:

TypeParameterName
struct bpf_verifier_env *env
intinsn_idx
struct bpf_insn *insn
3071  If ld/ldx fields ( opcode ) != 32-bit && ld/ldx fields ( opcode ) != double word (64-bit) || signed immediate constant != 0 Then
3073  verbose(env, "BPF_XADD uses reserved fields\n")
3074  Return -EINVAL
3078  err = check_reg_arg(env, source register , register is used as source operand )
3079  If err Then Return err
3083  err = check_reg_arg(env, dest register , register is used as source operand )
3084  If err Then Return err
3087  If is_pointer_value(env, source register ) Then
3088  verbose(env, "R%d leaks addr into mem\n", source register )
3089  Return -EACCES
3092  If is_ctx_reg(env, dest register ) || is_pkt_reg(env, dest register ) || is_flow_key_reg(env, dest register ) || is_sk_reg(env, dest register ) Then
3096  verbose(env, "BPF_XADD stores into R%d %s is not allowed\n", dest register , string representation of 'enum bpf_reg_type' [type])
3099  Return -EACCES
3103  err = heck whether memory at (regno + off) is accessible for t = (read | write)* if t==write, value_regno is a register which value is stored into memory* if t==read, value_regno is a register which will receive the value from memory* if t==write &&
3105  If err Then Return err
3109  Return heck whether memory at (regno + off) is accessible for t = (read | write)* if t==write, value_regno is a register which value is stored into memory* if t==read, value_regno is a register which will receive the value from memory* if t==write &&
Caller
NameDescribe
do_check