]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Test with a very short loop
authorEduard Zingerman <eddyz87@gmail.com>
Tue, 29 Oct 2024 17:26:41 +0000 (10:26 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 29 Oct 2024 18:42:23 +0000 (11:42 -0700)
commit1fb315892d8395cec2dae04b0cb5558731aefb37
treed3242f14cc4b2008b94dfd9153ebfcd3e5834b29
parentaa30eb3260b2dea3a68d3c42a39f9a09c5e99cee
selftests/bpf: Test with a very short loop

The test added is a simplified reproducer from syzbot report [1].
If verifier does not insert checkpoint somewhere inside the loop,
verification of the program would take a very long time.

This would happen because mark_chain_precision() for register r7 would
constantly trace jump history of the loop back, processing many
iterations for each mark_chain_precision() call.

[1] https://lore.kernel.org/bpf/670429f6.050a0220.49194.0517.GAE@google.com/

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20241029172641.1042523-2-eddyz87@gmail.com
tools/testing/selftests/bpf/progs/verifier_search_pruning.c
tools/testing/selftests/bpf/veristat.cfg