]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Avoid putting struct bpf_scc_callchain variables on the stack
authorYonghong Song <yonghong.song@linux.dev>
Thu, 3 Jul 2025 14:11:17 +0000 (07:11 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 4 Jul 2025 02:31:30 +0000 (19:31 -0700)
commit82bc4abf28d8147dd5da9ba52f0aa1bac23c125e
tree71b23ffbe8482b3edd886d34025022b164df8a01
parent45e9cd38aa8df9f4673d73bb86f7c9626d513a76
bpf: Avoid putting struct bpf_scc_callchain variables on the stack

Add a 'struct bpf_scc_callchain callchain_buf' field in bpf_verifier_env.
This way, the previous bpf_scc_callchain local variables can be
replaced by taking address of env->callchain_buf. This can reduce stack
usage and fix the following error:
    kernel/bpf/verifier.c:19921:12: error: stack frame size (1368) exceeds limit (1280) in 'do_check'
        [-Werror,-Wframe-larger-than]

Reported-by: Arnd Bergmann <arnd@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250703141117.1485108-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf_verifier.h
kernel/bpf/verifier.c