Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Return true if it's OK to have the same insn return a different type.

Proto:static bool reg_type_mismatch_ok(enum bpf_reg_type type)

Type:bool

Parameter:

TypeParameterName
enum bpf_reg_typetype
7703  Case type == g points to bpf_context
7704  Case type == g points to struct bpf_sock
7705  Case type == g points to struct bpf_sock or NULL
7706  Case type == g points to sock_common
7707  Case type == g points to sock_common or NULL
7708  Case type == g points to struct tcp_sock
7709  Case type == g points to struct tcp_sock or NULL
7710  Case type == g points to struct xdp_sock
7711  Case type == g points to kernel struct
7712  Return false
7713  Default
7714  Return true
Caller
NameDescribe
reg_type_mismatchIf an instruction was previously used with particular pointer types, then we* need to be careful to avoid cases such as the below, where it may be ok* for one branch accessing the pointer, but not ok for the other branch:* R1 = sock_ptr* goto X;*