• Steven Rostedt (VMware)'s avatar
    tracing: Fix memory leak of instance function hash filters · 2840f84f
    Steven Rostedt (VMware) authored
    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: 591dffda ("ftrace: Allow for function tracing instance to filter functions")
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    2840f84f
ftrace.c 165 KB