All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] tracing: instance_rmdir() leaks ftrace_event_file->filter
@ 2014-07-11 19:06 Oleg Nesterov
  2014-07-11 19:06 ` [PATCH 1/7] " Oleg Nesterov
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Oleg Nesterov @ 2014-07-11 19:06 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Masami Hiramatsu, Namhyung Kim, Srikar Dronamraju, Tom Zanussi,
	zhangwei(Jovi), linux-kernel

Hello,

Sorry for delay, I was distracted by other problems.

To remind, we discussed the potential uprobes "mix perf/ftrace" changes and
found some off-topic problems. Lets start with ->filter fixes/cleanups.

So far I didn't even try to test this series, although it looks simple except
perhaps the last patch. I'll try to somehow test this tomorrow, but I do not
really now how.

So please review, these patches need acks anyway.

As for 1/7, I added BUG_ON(file->filter) into remove_event_file_dir() before
kmem_cache_free() to verify that yes, the leak does exist. Perhaps this patch
should go to stable, or at least to v3.16.

--------------------------------------------------------------------------------
And could someone explain me why apply_subsystem_event_filter("0") clears
->filter_string first, then the whole ->filter? It seems that the only
thing filter_free_subsystem_preds() should do is filter_disable(), no?
IOW, why the patch below (on top of this series) is wrong?

Oleg.

--- x/kernel/trace/trace_events_filter.c
+++ x/kernel/trace/trace_events_filter.c
@@ -831,17 +831,6 @@ static int __alloc_preds(struct event_filter *filter, int n_preds)
 	return 0;
 }
 
-static inline void __remove_filter(struct ftrace_event_file *file)
-{
-	struct ftrace_event_call *call = file->event_call;
-
-	filter_disable(file);
-	if (call->flags & TRACE_EVENT_FL_USE_CALL_FILTER)
-		remove_filter_string(call->filter);
-	else
-		remove_filter_string(file->filter);
-}
-
 static void filter_free_subsystem_preds(struct event_subsystem *system,
 					struct trace_array *tr)
 {
@@ -850,7 +839,7 @@ static void filter_free_subsystem_preds(struct event_subsystem *system,
 	list_for_each_entry(file, &tr->events, list) {
 		if (file->system->subsystem != system)
 			continue;
-		__remove_filter(file);
+		filter_disable(file);
 	}
 }
 


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-07-15  0:18 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 19:06 [PATCH 0/7] tracing: instance_rmdir() leaks ftrace_event_file->filter Oleg Nesterov
2014-07-11 19:06 ` [PATCH 1/7] " Oleg Nesterov
2014-07-14 18:35   ` Steven Rostedt
2014-07-14 19:03     ` Oleg Nesterov
2014-07-11 19:06 ` [PATCH 2/7] tracing: kill destroy_preds() and destroy_file_preds() Oleg Nesterov
2014-07-11 19:06 ` [PATCH 3/7] tracing: kill destroy_call_preds() Oleg Nesterov
2014-07-11 19:06 ` [PATCH 4/7] tracing: kill call_filter_disable() Oleg Nesterov
2014-07-14 19:03   ` Steven Rostedt
2014-07-11 19:06 ` [PATCH 5/7] tracing/uprobes: kill the dead TRACE_EVENT_FL_USE_CALL_FILTER logic Oleg Nesterov
2014-07-14 19:04   ` Steven Rostedt
2014-07-15  0:18   ` Srikar Dronamraju
2014-07-11 19:06 ` [PATCH 6/7] tracing: kill ftrace_event_call->files Oleg Nesterov
2014-07-14 19:06   ` Steven Rostedt
2014-07-11 19:06 ` [PATCH 7/7] tracing: change filter_free_subsystem_*() to check ->subsystem rather then ->name Oleg Nesterov
2014-07-14 13:58   ` Namhyung Kim
2014-07-14 16:02     ` Oleg Nesterov
2014-07-14 19:21     ` Steven Rostedt
2014-07-14 19:20   ` Steven Rostedt
2014-07-14 19:23     ` Oleg Nesterov
2014-07-14 13:54 ` [PATCH 0/7] tracing: instance_rmdir() leaks ftrace_event_file->filter Namhyung Kim
2014-07-14 16:15   ` Oleg Nesterov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.