From: Alexei Starovoitov The GCC BPF jobs of BPF CI fail in: verifier_loop_latch/latch: frames of a stack walker The test is about the outer loop: 'if (frames == 8) break;' counts it, so out[idx + j] stays within the 256 words of the value. GCC unrolls the inner loop for (j = 0; j < n; j++) out[idx + j] = b + c + d + e; by 8, walks 'out' with a pointer and ends the loop with 'if r9 != r5', where both registers point into the map value. The verifier finds no count for that and says: invalid access to map value, value_size=2048 off=2048 size=8 Skip the prog with GCC, as plain_c_verifier_loop_as_is.c does for the same reason. The prog with nine frames is rejected with both compilers: it stays. Fixes: d0a8c63bfc66 ("selftests/bpf: Test loops that are counted, walked or widened") Signed-off-by: Alexei Starovoitov --- tools/testing/selftests/bpf/progs/verifier_loop_latch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/verifier_loop_latch.c b/tools/testing/selftests/bpf/progs/verifier_loop_latch.c index 8b9a2853ea05..35bb3e16db3d 100644 --- a/tools/testing/selftests/bpf/progs/verifier_loop_latch.c +++ b/tools/testing/selftests/bpf/progs/verifier_loop_latch.c @@ -206,6 +206,9 @@ int name(void *ctx) \ } OK("frames of a stack walker", "[0..9]") __retval(256) +#ifndef __clang__ +__skip("GCC unrolls the inner loop") +#endif FRAMES(eight_frames, 8) BAD("frames of a stack walker, one too many")