Skip to content

Commit

Permalink
tracing/events: fix concurrent access to ftrace_events list, fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed May 7, 2009
1 parent 5928c3c commit d94fc52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,15 @@ static int filter_add_subsystem_pred(struct filter_parse_state *ps,

err = filter_add_pred(ps, call, pred);
if (err) {
mutex_unlock(&event_mutex);
filter_free_subsystem_preds(system);
parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0);
break;
goto out;
}
replace_filter_string(call->filter, filter_string);
}
mutex_unlock(&event_mutex);

out:
return err;
}

Expand Down

0 comments on commit d94fc52

Please sign in to comment.