Skip to content

Commit 2598ac6

Browse files
samitolvanenctmarinas
authored andcommitted
arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER
The 0-day bot reports that arm64 builds with CONFIG_CFI_CLANG + CONFIG_FTRACE are broken when CONFIG_FUNCTION_GRAPH_TRACER is not enabled: ld.lld: error: undefined symbol: __kcfi_typeid_ftrace_stub_graph >>> referenced by entry-ftrace.S:299 (arch/arm64/kernel/entry-ftrace.S:299) >>> arch/arm64/kernel/entry-ftrace.o:(.text+0x48) in archive vmlinux.a This is caused by ftrace_stub_graph using SYM_TYPE_FUNC_START when the address of the function is not taken in any C translation unit. Fix the build by only defining ftrace_stub_graph when it's actually needed, i.e. with CONFIG_FUNCTION_GRAPH_TRACER. Link: https://lore.kernel.org/lkml/[email protected]/ Fixes: 883bbbf ("ftrace,kcfi: Separate ftrace_stub() and ftrace_stub_graph()") Reported-by: kernel test robot <[email protected]> Signed-off-by: Sami Tolvanen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Acked-by: Mark Rutland <[email protected]> Reviewed-by: Masami Hiramatsu (Google) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent f0c4d9f commit 2598ac6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm64/kernel/entry-ftrace.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ SYM_TYPED_FUNC_START(ftrace_stub)
299299
ret
300300
SYM_FUNC_END(ftrace_stub)
301301

302+
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
302303
SYM_TYPED_FUNC_START(ftrace_stub_graph)
303304
ret
304305
SYM_FUNC_END(ftrace_stub_graph)
305306

306-
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
307307
/*
308308
* void return_to_handler(void)
309309
*

0 commit comments

Comments
 (0)