linux-stable/kernel/trace
Alexei Starovoitov 8a141dd7f7 ftrace: Fix modify_ftrace_direct.
The following sequence of commands:
  register_ftrace_direct(ip, addr1);
  modify_ftrace_direct(ip, addr1, addr2);
  unregister_ftrace_direct(ip, addr2);
will cause the kernel to warn:
[   30.179191] WARNING: CPU: 2 PID: 1961 at kernel/trace/ftrace.c:5223 unregister_ftrace_direct+0x130/0x150
[   30.180556] CPU: 2 PID: 1961 Comm: test_progs    W  O      5.12.0-rc2-00378-g86bc10a0a711-dirty #3246
[   30.182453] RIP: 0010:unregister_ftrace_direct+0x130/0x150

When modify_ftrace_direct() changes the addr from old to new it should update
the addr stored in ftrace_direct_funcs. Otherwise the final
unregister_ftrace_direct() won't find the address and will cause the splat.

Fixes: 0567d68091 ("ftrace: Add modify_ftrace_direct()")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lore.kernel.org/bpf/20210316195815.34714-1-alexei.starovoitov@gmail.com
2021-03-17 00:43:12 +01:00
..
blktrace.c block-5.12-2021-02-27 2021-02-28 11:23:38 -08:00
bpf_trace.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-02-16 13:14:06 -08:00
bpf_trace.h
error_report-traces.c tracing: add error_report_end trace point 2021-02-26 09:41:02 -08:00
fgraph.c fgraph: Initialize tracing_graph_pause at task creation 2021-01-29 15:07:32 -05:00
ftrace.c ftrace: Fix modify_ftrace_direct. 2021-03-17 00:43:12 +01:00
ftrace_internal.h
Kconfig tracing: Fix help text of TRACEPOINT_BENCHMARK in Kconfig 2021-03-04 09:45:17 -05:00
kprobe_event_gen_test.c
Makefile tracing: add error_report_end trace point 2021-02-26 09:41:02 -08:00
power-traces.c
preemptirq_delay_test.c kernel: trace: preemptirq_delay_test: add cpu affinity 2021-02-02 17:02:07 -05:00
ring_buffer.c ring-buffer: Add a little more information and a WARN when time stamp going backwards is detected 2021-03-04 09:45:17 -05:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c tracing: Remove the useless value assignment in test_create_synth_event() 2020-11-13 12:19:52 -05:00
trace.c tracing: Skip selftests if tracing is disabled 2021-03-04 09:51:25 -05:00
trace.h tracing: Remove duplicate declaration from trace.h 2021-03-04 09:44:47 -05:00
trace_benchmark.c tracing: Fix some typos in comments 2020-11-10 20:39:40 -05:00
trace_benchmark.h
trace_boot.c tracing: Disable ftrace selftests when any tracer is running 2020-12-14 12:05:03 -05:00
trace_branch.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_clock.c
trace_dynevent.c tracing/dynevent: Delegate parsing to create function 2021-02-09 12:52:15 -05:00
trace_dynevent.h tracing/dynevent: Delegate parsing to create function 2021-02-09 12:52:15 -05:00
trace_entries.h tracing: Fix some typos in comments 2020-11-10 20:39:40 -05:00
trace_event_perf.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_events.c Tracing updates for 5.12 2021-02-22 14:07:15 -08:00
trace_events_filter.c tracing: Clean up after filter logic rewriting 2020-11-16 12:32:34 -05:00
trace_events_filter_test.h
trace_events_hist.c tracing: Fix some typos in comments 2020-11-10 20:39:40 -05:00
trace_events_inject.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_events_synth.c tracing: Fix memory leak in __create_synth_event() 2021-03-04 09:45:57 -05:00
trace_events_trigger.c
trace_export.c tracing: Fix some typos in comments 2020-11-10 20:39:40 -05:00
trace_functions.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_functions_graph.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_hwlat.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_irqsoff.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_kdb.c
trace_kprobe.c Modules updates for v5.12 2021-02-23 10:15:33 -08:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c tracing: Remove definition of DEBUG in trace_mmiotrace.c 2021-02-02 17:02:07 -05:00
trace_nop.c
trace_output.c tracing: Show real address for trace event arguments 2021-02-11 16:31:57 -05:00
trace_output.h ftrace: Add recording of functions that caused recursion 2020-11-06 08:42:26 -05:00
trace_preemptirq.c
trace_printk.c Updates for tracing and bootconfig: 2020-10-15 15:51:28 -07:00
trace_probe.c tracing/dynevent: Delegate parsing to create function 2021-02-09 12:52:15 -05:00
trace_probe.h tracing/dynevent: Delegate parsing to create function 2021-02-09 12:52:15 -05:00
trace_probe_tmpl.h
trace_recursion_record.c ftrace: Add recording of functions that caused recursion 2020-11-06 08:42:26 -05:00
trace_sched_switch.c
trace_sched_wakeup.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_selftest.c tracing: Disable ftrace selftests when any tracer is running 2020-12-14 12:05:03 -05:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c ftrace: Have the callbacks receive a struct ftrace_regs instead of pt_regs 2020-11-13 12:14:55 -05:00
trace_stat.c
trace_stat.h
trace_synth.h tracing: Add support for dynamic strings to synthetic events 2020-10-05 19:32:18 -04:00
trace_syscalls.c tracing: Merge irqflags + preempt counter. 2021-02-02 17:02:06 -05:00
trace_uprobe.c tracing/dynevent: Delegate parsing to create function 2021-02-09 12:52:15 -05:00
tracing_map.c tracing: Fix some typos in comments 2020-11-10 20:39:40 -05:00
tracing_map.h tracing: Fix some typos in comments 2020-11-10 20:39:40 -05:00