linux-brain/kernel/trace
zhangyi (F) 2193970482 tracing: Do not free iter->trace in fail path of tracing_open_pipe()
commit e7f0c424d0 upstream.

Commit d716ff71dd ("tracing: Remove taking of trace_types_lock in
pipe files") use the current tracer instead of the copy in
tracing_open_pipe(), but it forget to remove the freeing sentence in
the error path.

There's an error path that can call kfree(iter->trace) after the iter->trace
was assigned to tr->current_trace, which would be bad to free.

Link: http://lkml.kernel.org/r/1550060946-45984-1-git-send-email-yi.zhang@huawei.com

Cc: stable@vger.kernel.org
Fixes: d716ff71dd ("tracing: Remove taking of trace_types_lock in pipe files")
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 14:35:19 +01:00
..
Kconfig tracing: Prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y 2018-02-22 15:42:13 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
blktrace.c tracing/blktrace: Fix to allow setting same value 2018-09-09 19:55:57 +02:00
bpf_trace.c bpf: fix check of allowed specifiers in bpf_trace_printk 2018-12-17 09:28:50 +01:00
ftrace.c tracing: Fix memory leak of instance function hash filters 2018-12-21 14:13:06 +01:00
power-traces.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ring_buffer.c ring-buffer: Allow for rescheduling when removing pages 2018-09-29 03:06:04 -07:00
ring_buffer_benchmark.c ring-buffer: Have ring_buffer_alloc_read_page() return error on offline CPU 2017-08-02 14:23:02 -04:00
rpm-traces.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c tracing: Do not free iter->trace in fail path of tracing_open_pipe() 2019-03-23 14:35:19 +01:00
trace.h tracing: Make the snapshot trigger work with instances 2018-06-05 11:41:56 +02:00
trace_benchmark.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_benchmark.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_branch.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_clock.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
trace_entries.h tracing: Fix missing tab for hwlat_detector print format 2018-04-29 11:33:17 +02:00
trace_event_perf.c perf/ftrace: Fix double traces of perf on ftrace:function 2017-08-29 13:29:29 +02:00
trace_events.c tracing: Fix converting enum's from the map in trace_event_eval_update() 2018-01-23 19:58:16 +01:00
trace_events_filter.c tracing: Fix regex_match_front() to not over compare the test string 2018-05-16 10:10:27 +02:00
trace_events_filter_test.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_events_hist.c tracing: Use strncpy instead of memcpy for string keys in hist triggers 2019-03-23 14:35:19 +01:00
trace_events_trigger.c tracing: Fix memory leak in set_trigger_filter() 2018-12-21 14:13:06 +01:00
trace_export.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_functions.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_functions_graph.c tracing: Fix missing return symbol in function_graph output 2018-07-11 16:29:14 +02:00
trace_hwlat.c trace: make trace_hwlat timestamp y2038 safe 2017-05-08 17:15:15 -07:00
trace_irqsoff.c clocksource: Use a plain u64 instead of cycle_t 2016-12-25 11:04:12 +01:00
trace_kdb.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_kprobe.c tracing: Quiet gcc warning about maybe unused link variable 2018-08-03 07:50:21 +02:00
trace_mmiotrace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_nop.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_output.c tracing: Reorder display of TGID to be after PID 2018-07-17 11:39:30 +02:00
trace_output.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_printk.c tracing: Handle NULL formats in hold_module_trace_bprintk_format() 2016-06-20 09:46:12 -04:00
trace_probe.c tracing: probeevent: Fix to support minus offset from symbol 2018-03-28 18:24:42 +02:00
trace_probe.h tracing: probeevent: Fix to support minus offset from symbol 2018-03-28 18:24:42 +02:00
trace_sched_switch.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_sched_wakeup.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_selftest.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_selftest_dynamic.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_seq.c tracing: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
trace_stack.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_stat.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_stat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_syscalls.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_uprobe.c tracing/uprobes: Fix output for multiple string arguments 2019-02-20 10:20:53 +01:00
tracing_map.c tracing: Fix kmemleak in tracing_map_array_free() 2017-08-24 10:05:51 -04:00
tracing_map.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00