diff options
author | Alexei Starovoitov <ast@fb.com> | 2016-05-05 19:49:11 -0700 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2022-04-19 00:50:14 +0300 |
commit | 7bc109e280efab0e7e8f0b43b2ed687613e3fbdf (patch) | |
tree | a58e017d171c0f9437752ad53d9ce9c8a00ec765 /arch/x86/net/bpf_jit_comp.c | |
parent | dff8793e123bcf98ee73f61e3496a9d60e1bf279 (diff) |
bpf: improve verifier state equivalence
since UNKNOWN_VALUE type is weaker than CONST_IMM we can un-teach
verifier its recognition of constants in conditional branches
without affecting safety.
Ex:
if (reg == 123) {
.. here verifier was marking reg->type as CONST_IMM
instead keep reg as UNKNOWN_VALUE
}
Two verifier states with UNKNOWN_VALUE are equivalent, whereas
CONST_IMM_X != CONST_IMM_Y, since CONST_IMM is used for stack range
verification and other cases.
So help search pruning by marking registers as UNKNOWN_VALUE
where possible instead of CONST_IMM.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
Diffstat (limited to 'arch/x86/net/bpf_jit_comp.c')
0 files changed, 0 insertions, 0 deletions