Commit 478ece95 authored by Adrian Hunter's avatar Adrian Hunter Committed by Steven Rostedt (VMware)

ftrace: Fix missing synchronize_rcu() removing trampoline from kallsyms

Add synchronize_rcu() after list_del_rcu() in
ftrace_remove_trampoline_from_kallsyms() to protect readers of
ftrace_ops_trampoline_list (in ftrace_get_trampoline_kallsym)
which is used when kallsyms is read.

Link: https://lkml.kernel.org/r/20200901091617.31837-1-adrian.hunter@intel.com

Fixes: fc0ea795 ("ftrace: Add symbols for ftrace trampolines")
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent d5e47505
...@@ -2782,6 +2782,7 @@ static void ftrace_remove_trampoline_from_kallsyms(struct ftrace_ops *ops) ...@@ -2782,6 +2782,7 @@ static void ftrace_remove_trampoline_from_kallsyms(struct ftrace_ops *ops)
{ {
lockdep_assert_held(&ftrace_lock); lockdep_assert_held(&ftrace_lock);
list_del_rcu(&ops->list); list_del_rcu(&ops->list);
synchronize_rcu();
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment