summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2025-07-04 05:31:30 +0300
committerAlexei Starovoitov <ast@kernel.org>2025-07-04 05:31:30 +0300
commit03fe01ddd1d8be7799419ea5e5f228a0186ae8c2 (patch)
tree71b23ffbe8482b3edd886d34025022b164df8a01 /include
parent032547272eb0884470165e6a8fd73b80688e847f (diff)
parent82bc4abf28d8147dd5da9ba52f0aa1bac23c125e (diff)
downloadlinux-03fe01ddd1d8be7799419ea5e5f228a0186ae8c2.tar.xz
Merge branch 'bpf-reduce-verifier-stack-frame-size'
Yonghong Song says: ==================== bpf: Reduce verifier stack frame size Arnd Bergmann reported an issue ([1]) where clang compiler (less than llvm18) may trigger an error where the stack frame size exceeds the limit. I can reproduce the error like below: kernel/bpf/verifier.c:24491:5: error: stack frame size (2552) exceeds limit (1280) in 'bpf_check' [-Werror,-Wframe-larger-than] kernel/bpf/verifier.c:19921:12: error: stack frame size (1368) exceeds limit (1280) in 'do_check' [-Werror,-Wframe-larger-than] This patch series fixed the above two errors by reducing stack size. See each individual patches for details. [1] https://lore.kernel.org/bpf/20250620113846.3950478-1-arnd@kernel.org/ Changelogs: v2 -> v3: - v2: https://lore.kernel.org/bpf/20250702171134.2370432-1-yonghong.song@linux.dev/ - Rename env->callchain to env->callchain_buf so it is clear that - env->callchain_buf is used for a temp buf. v1 -> v2: - v1: https://lore.kernel.org/bpf/20250702053332.1991516-1-yonghong.song@linux.dev/ - Simplify assignment to struct bpf_insn pointer in do_misc_fixups(). - Restore original implementation in opt_hard_wire_dead_code_branches() as only one insn on the stack. - Avoid unnecessary insns for 64bit modulo (mod 0/-1) operations. ==================== Link: https://patch.msgid.link/20250703141101.1482025-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bpf_verifier.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h
index 7e459e839f8b..94defa405c85 100644
--- a/include/linux/bpf_verifier.h
+++ b/include/linux/bpf_verifier.h
@@ -841,6 +841,7 @@ struct bpf_verifier_env {
char tmp_str_buf[TMP_STR_BUF_LEN];
struct bpf_insn insn_buf[INSN_BUF_SIZE];
struct bpf_insn epilogue_buf[INSN_BUF_SIZE];
+ struct bpf_scc_callchain callchain_buf;
/* array of pointers to bpf_scc_info indexed by SCC id */
struct bpf_scc_info **scc_info;
u32 scc_cnt;