summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-10-20 00:14:28 +0000
committerAlexei Starovoitov <ast@kernel.org>2026-10-20 00:14:28 +0000
commitb2914fb67fbbfcd7ab1a855c167595b363212613 (patch)
tree144ec03e798fc99fd2a5529277ab6ea7916dfc88 /kernel
parent0867b7bfa9de65674c6e599fa21b762b71011b14 (diff)
parenta81bd9262cde4b002b95e652453ce5b815c79a62 (diff)
Merge branch 'bpf-fix-builds-broken-by-fatal-resolve_btfids-warnings'
Sasha Levin says: ==================== bpf: Fix builds broken by fatal resolve_btfids warnings Commit 201a454df948 ("resolve_btfids: Fix the --fatal_warnings exit status") makes resolve_btfids warnings fail the build again with CONFIG_WERROR=y. That exposed BTF ID references to functions some configs don't build. KernelCI has been seeing i386 i386_defconfig+kselftest builds fail on linux-next since next-20261015: WARN: resolve_btfids: unresolved symbol bpf_arena_reserve_pages WARN: resolve_btfids: unresolved symbol bpf_arena_free_pages WARN: resolve_btfids: unresolved symbol bpf_arena_alloc_pages Failed to generate BTF for vmlinux Try to disable CONFIG_DEBUG_INFO_BTF https://files.kernelci.org/kbuild-gcc-14-i386-kselftest-6ad2315ca3f195e1aa930c8a/build.log.gz Patch 1 drops three special_kfunc_list entries that have no users, bpf_arena_reserve_pages among them. Patch 2 makes the remaining arena entries depend on the condition arena.o is built with. Patch 3 fixes the same problem for bpf_lsm_socket_sendmsg in bpf_ksock.c, which breaks x86_64 builds with CONFIG_BPF_LSM=y and CONFIG_SECURITY_NETWORK=n. The entries left in special_kfunc_list resolve to the same IDs as before, and the IDs that become BTF_ID_UNUSED were already zero. Tested by building vmlinux with CONFIG_DEBUG_INFO_BTF=y and CONFIG_WERROR=y for i386, x86_64, and x86_64 with CONFIG_BPF_LSM=y and both CONFIG_SECURITY_NETWORK=n and =y, and comparing special_kfunc_list and bpf_lsm_socket_sendmsg_id before and after the series. ==================== Link: https://patch.msgid.link/20261019211006.2574350-1-sashal@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/bpf/verifier.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 015dc1bccebe..264da570a0a5 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -13612,10 +13612,7 @@ enum special_kfunc_type {
KF_bpf_call_rcu_tasks_trace,
KF_bpf_arena_alloc_pages,
KF_bpf_arena_free_pages,
- KF_bpf_arena_reserve_pages,
KF_bpf_session_is_return,
- KF_bpf_stream_vprintk,
- KF_bpf_stream_print_stack,
};
BTF_ID_LIST(special_kfunc_list)
@@ -13705,16 +13702,18 @@ BTF_ID(func, bpf_task_work_schedule_signal)
BTF_ID(func, bpf_task_work_schedule_resume)
BTF_ID(func, bpf_call_rcu)
BTF_ID(func, bpf_call_rcu_tasks_trace)
+#if defined(CONFIG_MMU) && defined(CONFIG_64BIT)
BTF_ID(func, bpf_arena_alloc_pages)
BTF_ID(func, bpf_arena_free_pages)
-BTF_ID(func, bpf_arena_reserve_pages)
+#else
+BTF_ID_UNUSED
+BTF_ID_UNUSED
+#endif
#ifdef CONFIG_BPF_EVENTS
BTF_ID(func, bpf_session_is_return)
#else
BTF_ID_UNUSED
#endif
-BTF_ID(func, bpf_stream_vprintk)
-BTF_ID(func, bpf_stream_print_stack)
static bool is_bpf_cast_to_kern_ctx_kfunc(const struct bpf_call_arg_meta *meta)
{