diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-05-07 03:11:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-07 04:07:28 -0400 |
commit | d94fc523f3c35bd8013f04827e94756cbc0212f4 (patch) | |
tree | aacd8c0aaa2024437b7bfba4636afcc87f4890bf /kernel | |
parent | 5928c3cc0ffcb6894bbab6be591b7ae1786b2d87 (diff) |
tracing/events: fix concurrent access to ftrace_events list, fix
In filter_add_subsystem_pred() we should release event_mutex before
calling filter_free_subsystem_preds(), since both functions hold
event_mutex.
[ Impact: fix deadlock when writing invalid pred into subsystem filter ]
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: tzanussi@gmail.com
Cc: a.p.zijlstra@chello.nl
Cc: fweisbec@gmail.com
Cc: rostedt@goodmis.org
LKML-Reference: <4A028993.7020509@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_events_filter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 8c62e5bdff09..85ad6a8939ad 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -636,14 +636,15 @@ static int filter_add_subsystem_pred(struct filter_parse_state *ps, | |||
636 | 636 | ||
637 | err = filter_add_pred(ps, call, pred); | 637 | err = filter_add_pred(ps, call, pred); |
638 | if (err) { | 638 | if (err) { |
639 | mutex_unlock(&event_mutex); | ||
639 | filter_free_subsystem_preds(system); | 640 | filter_free_subsystem_preds(system); |
640 | parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0); | 641 | parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0); |
641 | break; | 642 | goto out; |
642 | } | 643 | } |
643 | replace_filter_string(call->filter, filter_string); | 644 | replace_filter_string(call->filter, filter_string); |
644 | } | 645 | } |
645 | mutex_unlock(&event_mutex); | 646 | mutex_unlock(&event_mutex); |
646 | 647 | out: | |
647 | return err; | 648 | return err; |
648 | } | 649 | } |
649 | 650 | ||