Open sbezverk opened 3 years ago
@yonghong-song Appreciate if you could check, I found some of your suggestion to work around similar issues, unfortunately in my case they do not work. Thanks a lot!
Could you construct a self-contained example so I can take a look? Which kernel version did you use? I am asking since recent kernel improved alu32 tracking (32-bit register tracking like w7 above). For example, for
R4_w=inv(id=0,umax_value=1023,var_off=(0x0; 0x3ff))
I did not see update for {s, u}32_max/min_value, s{min, max}_value etc. Maybe some verifier improvements are needed.
@yonghong-song It is a bit hard to build self contained example,
here is my kernel version:
Linux dev-ubuntu-1 5.10.10-051010-generic #202101231639 SMP Sat Jan 23 17:16:37 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
If you could think of a way to improve verifier, please let me know, I can easily test it.
maybe you could post your bpf program? It may not work out of box, but people may be able to tweak your program to reproduce the issue?
@sbezverk did you ever figure this one out? I'm having the same problem using Rust + Aya. Even out of the box examples are failing. I also find that if I make the length a constant then the problem goes away.
Hello,
I am getting verifier failure despite of using suggested workarounds to make verifier happy. Here is the fragment of the code triggering verifier failure:
Verifier error:
When I use a constant instead of a
data_length
variable verifier passes:In both working and non working cases R3 looks exactly the same:
R3_w=map_value(id=0,off=0,ks=4,vs=1024,imm=0)
the difference is how length parameter is viewed:R7=invP(id=0,umax_value=1023,var_off=(0x0; 0x3ff))
which make sense andR4_w=inv64
I would appreciate if somebody could suggest what else can be done to make verifier happy.