]> git.hungrycats.org Git - linux/commit
selftests/bpf: Work around llvm stack overflow in crypto progs
authorAlexei Starovoitov <ast@kernel.org>
Mon, 15 Jun 2026 07:17:58 +0000 (00:17 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 15 Jun 2026 07:19:44 +0000 (00:19 -0700)
commite4287bf34f97a88c7d9322f5bde828724c073a6b
treeee165ab68a6fa74352bd7f4843253f9edb4a1fbc
parent4e7c52b178a75d9e733761ccae9fc25eaa7d8583
selftests/bpf: Work around llvm stack overflow in crypto progs

clang 23 fails to build crypto_bench.c and crypto_sanity.c with
"BPF stack limit exceeded". The progs fill a 408-byte
bpf_crypto_params on the stack and pass it to bpf_crypto_ctx_create().
clang 23 copies the byte-aligned cipher/key globals into it one byte at
a time through the stack, and keeps more than one copy of the struct
around. Together that blows the 512-byte limit.

Align the source arrays to 8 bytes so the copy is word-wise, and move
params off the stack into a static .bss var. static keeps it out of the
skeleton, where bpf_crypto_params is an incomplete type. Either change
alone is not enough.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/crypto_bench.c
tools/testing/selftests/bpf/progs/crypto_sanity.c