Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mpute branch direction of the expression "if (reg opcode val) goto target;"* and return:* 1 - branch will be taken and "goto target" will be executed* 0 - branch will not be taken and fall-through to next insn* -1 - unknown

Proto:static int is_branch_taken(struct bpf_reg_state *reg, u64 val, u8 opcode, bool is_jmp32)

Type:int

Parameter:

TypeParameterName
struct bpf_reg_state *reg
u64val
u8opcode
boolis_jmp32
5435  If __is_pointer_value(TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., reg) Then Return -1
5438  If is_jmp32 Then
5439  reg_lo = reg
5440  reg = reg_lo
5445  runcate register to smaller size (in bytes)* must be called with size < BPF_REG_SIZE
5464  minimum possible (s64)value = minimum possible (s64)value
5465  maximum possible (s64)value = maximum possible (s64)value
5467  val = val
5468  sval = val
5469  Else
5470  sval = val
5474  Case opcode == BPF_JEQ
5477  Break
5478  Case opcode == jump !=
5481  Break
5482  Case opcode == BPF_JSET
5483  If ~mask & value & val Then Return 1
5485  If Not ((mask | value) & val) Then Return 0
5487  Break
5488  Case opcode == BPF_JGT
5489  If minimum possible (u64)value > val Then Return 1
5491  Else if maximum possible (u64)value <= val Then Return 0
5493  Break
5495  If minimum possible (s64)value > sval Then Return 1
5497  Else if maximum possible (s64)value < sval Then Return 0
5499  Break
5501  If maximum possible (u64)value < val Then Return 1
5503  Else if minimum possible (u64)value >= val Then Return 0
5505  Break
5506  Case opcode == SLT is signed, '<'
5507  If maximum possible (s64)value < sval Then Return 1
5509  Else if minimum possible (s64)value >= sval Then Return 0
5511  Break
5512  Case opcode == BPF_JGE
5513  If minimum possible (u64)value >= val Then Return 1
5515  Else if maximum possible (u64)value < val Then Return 0
5517  Break
5519  If minimum possible (s64)value >= sval Then Return 1
5521  Else if maximum possible (s64)value < sval Then Return 0
5523  Break
5525  If maximum possible (u64)value <= val Then Return 1
5527  Else if minimum possible (u64)value > val Then Return 0
5529  Break
5531  If maximum possible (s64)value <= sval Then Return 1
5533  Else if minimum possible (s64)value > sval Then Return 0
5535  Break
5538  Return -1
Caller
NameDescribe
check_cond_jmp_op