summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/verifier_large_stack.c
AgeCommit message (Collapse)Author
2026-09-24selftests/bpf: Test the 2 KiB stack budgetKumar Kartikeya Dwivedi
Add tests for the stack budget of JITs with large stack support: a single 2 KiB frame, with and without may_goto, four 512-byte frames that fit the budget and five that do not, a 512-byte frame calling a 1536-byte static subprog, global subprog or bpf_loop() callback and the same with eight bytes too many, variable offset writes reaching exactly the budget and past it, a tail call made from a 1 KiB frame, and two 2 KiB frames on a private stack, where each frame gets the whole budget. A program with a 2 KiB frame is checked to be rejected wherever the budget is 512 bytes, and a 1 KiB frame is rejected in a program calling bpf_clone_redirect() but accepted in one calling bpf_redirect(). Two tests run such programs: a tail call made from a subprog with a 1536-byte frame under a 240-byte caller into a program with a 2 KiB frame, and a struct_ops program on a private stack calling a subprog when both frames are 2 KiB. Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20260924165740.2146806-19-memxor@gmail.com