-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make prime conformance test pass #423
Conversation
The fix looks good to me. You probably need to do the same for the narrowing phase (https://github.com/vbpf/ebpf-verifier/blob/main/src/crab/fwd_analyzer.cpp#L206) but I would try to debug first. Probably in this case the analyzer won't be unsound but it might not be effective. The reason why took me longer to reply was to see why the analyzer cannot prove the program. See next message |
This is the essence of the program:
After widening we infer that In any case, the problem is that the widening is too aggressive because it jumps directly to -oo or +oo. In ebpf programs we expect that loops are bounded to relatively small numbers so during widening we could jump to smaller numbers (e.g., 1000, 5000, etc) and of course jumping to +oo if convergence is not achieved after few iterations. In this way, we wouldn't give up so early by assuming that arithmetic operations can overflow. |
Fixes vbpf#416 There may be a better fix that makes the test pass, but for now the fix implied by Jorge resolves the issue of an incorrect computation. Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
@elazarg any idea why the analyze pass failed? The error looks unrelated to this PR. |
Looks to be due to this change in Linux: https://stackoverflow.com/questions/71454588/minsigstksz-error-after-update-in-my-manjaro-linux and covered by catch2 here: catchorg/Catch2#2421 |
Signed-off-by: Dave Thaler <[email protected]>
@elazarg Ok I fixed the analyze problem with catch2 by updating to use the latest header which fixed both this issue and the one you previously had to work around by editing catch.hpp. Anything else needed before merging? |
Fixes #416
prime.data now returns either true or false, passing verification.
The best answer would be to know it always returns true, but it is at least not unsafe now.
Signed-off-by: Dave Thaler [email protected]