Skip to content

Commit

Permalink
ftrace: Fix unmatched locking in ftrace_regex_write()
Browse files Browse the repository at this point in the history
When a command is passed to the set_ftrace_filter, then
the ftrace_regex_lock is still held going back to user space.

 # echo 'do_open : foo' > set_ftrace_filter
 (still holding ftrace_regex_lock when returning to user space!)

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4AEF7F8A.3080300@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Li Zefan authored and Steven Rostedt committed Nov 4, 2009
1 parent f711294 commit ed146b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2222,15 +2222,15 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
ret = ftrace_process_regex(parser->buffer,
parser->idx, enable);
if (ret)
goto out;
goto out_unlock;

trace_parser_clear(parser);
}

ret = read;

out_unlock:
mutex_unlock(&ftrace_regex_lock);
out:

return ret;
}

Expand Down

0 comments on commit ed146b2

Please sign in to comment.