mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Oleg Nesterov <oleg@redhat.com>
Subject: [GIT PULL] tracing: instance_rmdir() leaks ftrace_event_file->filter
Date: Tue, 15 Jul 2014 12:24:26 -0400	[thread overview]
Message-ID: <20140715122426.7f2c8cd1@gandalf.local.home> (raw)


Linus,

Oleg Nesterov fixed a memory leak that happens if a user creates
a tracing instance, sets up a filter in an event, and then removes
that instance. The filter allocates memory that is never freed
when the instance is destroyed.

Please pull the latest trace-fixes-v3.16-rc5 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-fixes-v3.16-rc5

Tag SHA1: 669ea50dfcff14f49119e15133c0b0eb32d1999a
Head SHA1: 2448e3493cb3874baa90725c87869455ebf11cd2


Oleg Nesterov (1):
      tracing: instance_rmdir() leaks ftrace_event_file->filter

----
 kernel/trace/trace_events.c | 1 +
 1 file changed, 1 insertion(+)
---------------------------
commit 2448e3493cb3874baa90725c87869455ebf11cd2
Author: Oleg Nesterov <oleg@redhat.com>
Date:   Fri Jul 11 21:06:38 2014 +0200

    tracing: instance_rmdir() leaks ftrace_event_file->filter
    
    instance_rmdir() path destroys the event files but forgets to free
    file->filter. Change remove_event_file_dir() to free_event_filter().
    
    Link: http://lkml.kernel.org/p/20140711190638.GA19517@redhat.com
    
    Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
    Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
    Cc: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
    Cc: stable@vger.kernel.org # 3.11+
    Fixes: f6a84bdc75b5 "tracing: Introduce remove_event_file_dir()"
    Signed-off-by: Oleg Nesterov <oleg@redhat.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index f99e0b3bca8c..2de53628689f 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -470,6 +470,7 @@ static void remove_event_file_dir(struct ftrace_event_file *file)
 
 	list_del(&file->list);
 	remove_subsystem(file->system);
+	free_event_filter(file->filter);
 	kmem_cache_free(file_cachep, file);
 }
 

                 reply	other threads:[~2014-07-15 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140715122426.7f2c8cd1@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®