diff options
author | Borislav Petkov <[email protected]> | 2019-11-18 18:20:12 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2019-11-27 07:44:24 +0100 |
commit | 38ebd8d119245eecb99fe00b0f57e269baf22767 (patch) | |
tree | b963b084d1c70deb77ea3d60296c9e7540542583 | |
parent | 4531ef6a8aaf132aa32e2e26670c652942540633 (diff) |
x86/ftrace: Mark ftrace_modify_code_direct() __ref
... because it calls the .init.text function text_poke_early(). That is
ok because it does call that function early, during boot.
Fixes: 9706f7c3531f ("x86/ftrace: Use text_poke()")
Suggested-by: Peter Zijlstra <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Acked-by: Steven Rostedt (VMware) <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Daniel Bristot de Oliveira <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
-rw-r--r-- | arch/x86/kernel/ftrace.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 2a179fb35cd1..108ee96f8b66 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -99,7 +99,12 @@ static int ftrace_verify_code(unsigned long ip, const char *old_code) return 0; } -static int +/* + * Marked __ref because it calls text_poke_early() which is .init.text. That is + * ok because that call will happen early, during boot, when .init sections are + * still present. + */ +static int __ref ftrace_modify_code_direct(unsigned long ip, const char *old_code, const char *new_code) { |