mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 05:48:40 +00:00
arm64: ftrace: use function_nocfi for ftrace_call
With CONFIG_CFI_CLANG, the compiler replaces function pointers with jump table addresses, which breaks dynamic ftrace as the address of ftrace_call is replaced with the address of ftrace_call.cfi_jt. Use function_nocfi() to get the address of the actual function instead. Suggested-by: Ben Dai <ben.dai@unisoc.com> Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210408182843.1754385-17-samitolvanen@google.com
This commit is contained in:
parent
9562f3dc6f
commit
800618f955
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
|
|||
unsigned long pc;
|
||||
u32 new;
|
||||
|
||||
pc = (unsigned long)&ftrace_call;
|
||||
pc = (unsigned long)function_nocfi(ftrace_call);
|
||||
new = aarch64_insn_gen_branch_imm(pc, (unsigned long)func,
|
||||
AARCH64_INSN_BRANCH_LINK);
|
||||
|
||||
|
|
Loading…
Reference in a new issue