]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Fix memory leak of instance function hash filters
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 11 Dec 2018 04:58:01 +0000 (23:58 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 11 Dec 2018 18:50:28 +0000 (13:50 -0500)
commit5a0f9450a70273c7398970fb79ad604b81597df5
treed34045c522b96a57bd2ca29c089cf6df8d9d6b6e
parenta576b02bea74ca3544d597a6d95b5a2fb81ffb20
tracing: Fix memory leak of instance function hash filters

The following commands will cause a memory leak:

 # cd /sys/kernel/tracing
 # mkdir instances/foo
 # echo schedule > instance/foo/set_ftrace_filter
 # rmdir instances/foo

The reason is that the hashes that hold the filters to set_ftrace_filter and
set_ftrace_notrace are not freed if they contain any data on the instance
and the instance is removed.

Found by kmemleak detector.

Cc: stable@vger.kernel.org
Fixes: d9a1e388ef00 ("ftrace: Allow for function tracing instance to filter functions")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/ftrace.c