[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A028993.7020509@cn.fujitsu.com>
Date: Thu, 07 May 2009 15:11:15 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: mingo@...hat.com
CC: hpa@...or.com, linux-kernel@...r.kernel.org, tzanussi@...il.com,
a.p.zijlstra@...llo.nl, fweisbec@...il.com, rostedt@...dmis.org,
tglx@...utronix.de, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:tracing/core] tracing/events: fix concurrent access to ftrace_events
list
tip-bot for Li Zefan wrote:
> Commit-ID: 20c8928abe70e204bd077ab6cfe23002d7788983
> Gitweb: http://git.kernel.org/tip/20c8928abe70e204bd077ab6cfe23002d7788983
> Author: Li Zefan <lizf@...fujitsu.com>
> AuthorDate: Wed, 6 May 2009 10:33:45 +0800
> Committer: Ingo Molnar <mingo@...e.hu>
> CommitDate: Wed, 6 May 2009 10:38:19 +0200
>
> tracing/events: fix concurrent access to ftrace_events list
>
There is a deadlock in this patch, and I sent out a v2 patch and
expected it to be applied:
http://lkml.org/lkml/2009/5/6/26
Below is a fix on top of this patch. Sorry for my carelessness.
=========
From: Li Zefan <lizf@...fujitsu.com>
Subject: [PATCH] tracing/events: fix deadlock on event_mutex
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@...fujitsu.com>
---
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 8c62e5b..85ad6a8 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,
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;
}
--
1.5.4.rc3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists