Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:check_return_code

Proto:static int check_return_code(struct bpf_verifier_env *env)

Type:int

Parameter:

TypeParameterName
struct bpf_verifier_env *env
6362  enforce_attach_type_range = A completely unknown value
6364  range = A value that's unknown except that @min <= value <= @max
6367  Case Type of BPF program == BPF_PROG_TYPE_CGROUP_SOCK_ADDR
6368  If For some prog types == BPF_CGROUP_UDP4_RECVMSG || For some prog types == BPF_CGROUP_UDP6_RECVMSG Then range = A value that's unknown except that @min <= value <= @max
6371  Break
6372  Case Type of BPF program == BPF_PROG_TYPE_CGROUP_SKB
6377  Break
6378  Case Type of BPF program == BPF_PROG_TYPE_CGROUP_SOCK
6379  Case Type of BPF program == BPF_PROG_TYPE_SOCK_OPS
6380  Case Type of BPF program == BPF_PROG_TYPE_CGROUP_DEVICE
6381  Case Type of BPF program == BPF_PROG_TYPE_CGROUP_SYSCTL
6382  Case Type of BPF program == BPF_PROG_TYPE_CGROUP_SOCKOPT
6383  Break
6384  Case Type of BPF program == BPF_PROG_TYPE_RAW_TRACEPOINT
6385  If Not in-kernel BTF type id to attach to Then Return 0
6387  range = Represent a known constant as a tnum.
6388  Break
6389  Default
6390  Return 0
6393  reg = cur_regs(env) + BPF_REG_0
6394  If Ordering of fields matters. See states_equal() != g doesn't contain a valid pointer Then
6395  verbose(env, "At program exit the register R0 is not a known value (%s)\n", string representation of 'enum bpf_reg_type' [ Ordering of fields matters. See states_equal() ])
6397  Return -EINVAL
6400  If Not Returns true if @b represents a subset of @a. Then
6403  verbose(env, "At program exit the register R0 ")
6406  verbose(env, "has value %s", tn_buf)
6407  Else
6408  verbose(env, "has unknown scalar value")
6410  Format a tnum as a pair of hex numbers (value; mask)
6411  verbose(env, " should have been in %s\n", tn_buf)
6412  Return -EINVAL
6415  If Not Returns true if @a is completely unknown && Returns true if @b represents a subset of @a. Then Enforce expected_attach_type checking at attach time = 1
6418  Return 0
Caller
NameDescribe
do_check