linux-uconsole/kernel/trace
Kamal Agrawal 0671bafa24
UPSTREAM: tracing: Fix NULL pointer dereference in start_creating
The event_trace_add_tracer() can fail. In this case, it leads to a crash
in start_creating with below call stack. Handle the error scenario
properly in trace_array_create_dir.

Call trace:
down_write+0x7c/0x204
start_creating.25017+0x6c/0x194
tracefs_create_file+0xc4/0x2b4
init_tracer_tracefs+0x5c/0x940
trace_array_create_dir+0x58/0xb4
trace_array_create+0x1bc/0x2b8
trace_array_get_by_name+0xdc/0x18c

Link: https://lkml.kernel.org/r/1627651386-21315-1-git-send-email-kamaagra@codeaurora.org

Cc: stable@vger.kernel.org
Fixes: 4114fbfd02 ("tracing: Enable creating new instance early boot")
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Bug: 200485226
Change-Id: I79946d9bfc3ffd129bbb1e5fa6460ec0a51f8e59
(cherry picked from commit ff41c28c4b)
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
2021-09-20 19:02:31 +05:30
..
blktrace.c block: add a bdget_part helper 2020-10-05 10:38:33 -06:00
bpf_trace.c bpf, lockdown, audit: Fix buggy SELinux lockdown permission checks 2021-06-10 13:39:19 +02:00
bpf_trace.h
error_report-traces.c FROMGIT: tracing: add error_report_end trace point 2021-02-05 09:20:54 -08:00
fgraph.c fgraph: Initialize tracing_graph_pause at task creation 2021-02-10 09:29:16 +01:00
ftrace.c ftrace: Handle commands when closing set_ftrace_filter file 2021-05-11 14:47:12 +02:00
ftrace_internal.h
Kconfig ANDROID: tracing: Make automounting in debugfs optional 2021-04-06 13:01:51 +00:00
kprobe_event_gen_test.c
Makefile FROMGIT: tracing: add error_report_end trace point 2021-02-05 09:20:54 -08:00
power-traces.c ANDROID: sched: cpufreq_schedutil: move sugov traces to sched 2021-01-12 12:57:37 -08:00
preemptirq_delay_test.c
ring_buffer.c ring-buffer: Force before_stamp and write_stamp to be different on discard 2021-03-09 11:11:12 +01:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c tracing: Add support for dynamic strings to synthetic events 2020-10-05 19:32:18 -04:00
trace.c UPSTREAM: tracing: Fix NULL pointer dereference in start_creating 2021-09-20 19:02:31 +05:30
trace.h tracing: Disable ftrace selftests when any tracer is running 2020-12-30 11:54:28 +01:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c tracing: Disable ftrace selftests when any tracer is running 2020-12-30 11:54:28 +01:00
trace_branch.c
trace_clock.c tracing: Restructure trace_clock_global() to never block 2021-05-11 14:47:40 +02:00
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_event_perf.c
trace_events.c tracing: Do not count ftrace events in top level enable output 2021-02-17 11:02:20 +01:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c tracing: Check return value of __create_val_fields() before using its result 2020-10-15 12:00:59 -04:00
trace_events_inject.c
trace_events_synth.c tracing: Make -ENOMEM the default error for parse_synth_field() 2020-11-02 15:58:32 -05:00
trace_events_trigger.c
trace_export.c treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
trace_functions.c
trace_functions_graph.c
trace_hwlat.c tracing: Remove WARN_ON in start_thread() 2020-11-30 21:43:07 -05:00
trace_irqsoff.c tracing: Use pause-on-trace with the latency tracers 2021-02-10 09:29:16 +01:00
trace_kdb.c
trace_kprobe.c tracing/kprobe: Fix to support kretprobe events on unloaded modules 2021-02-10 09:29:16 +01:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_preemptirq.c ANDROID: tracing: Add restricted vendor hooks for preemptirq events 2020-12-03 17:44:38 +00:00
trace_printk.c Updates for tracing and bootconfig: 2020-10-15 15:51:28 -07:00
trace_probe.c
trace_probe.h tracing: Move is_good_name() from trace_probe.h to trace.h 2020-10-15 12:01:13 -04:00
trace_probe_tmpl.h
trace_readwrite.c ANDROID: tracing: Add register read and write tracing support 2021-01-11 16:43:50 +00:00
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c tracing: Disable ftrace selftests when any tracer is running 2020-12-30 11:54:28 +01:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
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
trace_uprobe.c
tracing_map.c
tracing_map.h