From 40a3a2e686f8c749bb6420ace8190c49f712217e Mon Sep 17 00:00:00 2001 From: Alexei Starovoitov Date: Sat, 31 Oct 2026 21:55:37 +0000 Subject: [PATCH] selftests/bpf: Give the first loop of cond_break5 an end The main prog of cond_break5 spins until may_goto stops the loop. Then it calls a subprog and expects that the loop of the subprog makes iterations. This is true only while each stack frame has a time slice of its own. Stop the first loop after 100 iterations. The test still makes sure that may_goto works in the main prog and in a subprog of one prog. Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261031215543.682284-4-alexei.starovoitov@gmail.com --- .../selftests/bpf/progs/verifier_iterating_callbacks.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c b/tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c index 1fbcc5228306..4dd98acc6436 100644 --- a/tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c +++ b/tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c @@ -553,7 +553,11 @@ int cond_break5(const void *ctx) { int cnt1 = zero, cnt2; - for (;;) { + /* + * There is one time slice for all may_goto of the prog. When it's used up a function that + * is called after that makes no iteration. So this loop has an end. + */ + for (; cnt1 < 100;) { cond_break; cnt1++; }