Comment 5 for bug 1934414

Revision history for this message
Kleber Sacilotto de Souza (kleber-souza) wrote :

As Thadeu mentioned, this happens because the test_bpf module doesn't go through the verifier causing the failure when the code is not jitted. Upstream fixed the testcase with 21ccaf21497b (bpf: add further test cases around div/mod and others) by replacing "INT: DIV by zero" by "INT: DIV by -1" on test_bpf and moving/adding the div by zero tests to tools/testing/selftests/bpf/test_verifier.c.

Changing the div test from zero to -1 in bionic is trivial, however this would leave the zero case uncovered. Making the proper fix would require backporting 21ccaf21497b, which in turn would need at least 87c1793b1b7f (bpf: add couple of test cases for div/mod by zero) and 111e6b45315c (selftests/bpf: make test_verifier run most programs) but possibly many others.