Fix accessing the __rcu pointer direct_functions with RCU protection.
Unified · Split
| @@ -2645,7 +2645,8 @@ unsigned long ftrace_find_rec_direct(unsigned long ip) · 2644 unmodified lines | ||
| 2645 | 2645 | { |
| 2646 | 2646 | struct ftrace_func_entry *entry; |
| 2647 | 2647 | |
| 2648 | − entry = __ftrace_lookup_ip(direct_functions, ip); | |
| 2648 | + guard(preempt_notrace)(); | |
| 2649 | + entry = __ftrace_lookup_ip(rcu_dereference_sched(direct_functions), ip); | |
| 2649 | 2650 | if (!entry) |
| 2650 | 2651 | return 0; |
| 2651 | 2652 | |