diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-07-19 11:36:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-04 04:50:43 -0400 |
commit | e55679914313bbfc003dcdf8ff74a16dec2fe24d (patch) | |
tree | 202596b1d2f367a3c1fa82ef845fbed1b176cb72 /kernel/trace | |
parent | e45ccd09b53e4cd60941891ad6992579ebc78024 (diff) |
tracing: Kill the unbalanced tr->ref++ in tracing_buffers_open()
commit e70e78e3c83b536730e31231dd9b979768d8df3c upstream.
tracing_buffers_open() does trace_array_get() and then it wrongly
inrcements tr->ref again under trace_types_lock. This means that
every caller leaks trace_array:
# cd /sys/kernel/debug/tracing/
# mkdir instances/X
# true < instances/X/per_cpu/cpu0/trace_pipe_raw
# rmdir instances/X
rmdir: failed to remove `instances/X': Device or resource busy
Link: http://lkml.kernel.org/r/20130719153644.GA18899@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 97e750110b5a..073b9e041d32 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4907,8 +4907,6 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp) | |||
4907 | 4907 | ||
4908 | mutex_lock(&trace_types_lock); | 4908 | mutex_lock(&trace_types_lock); |
4909 | 4909 | ||
4910 | tr->ref++; | ||
4911 | |||
4912 | info->iter.tr = tr; | 4910 | info->iter.tr = tr; |
4913 | info->iter.cpu_file = tc->cpu; | 4911 | info->iter.cpu_file = tc->cpu; |
4914 | info->iter.trace = tr->current_trace; | 4912 | info->iter.trace = tr->current_trace; |