• Matt Fleming's avatar
    tracing: Fix infinite recursion in ftrace_update_pid_func() · 33974093
    Matt Fleming authored
    When CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST is enabled
    __ftrace_trace_function contains the current trace function, not
    ftrace_trace_function.
    
    In ftrace_update_pid_func() we currently incorrectly assign the
    value of ftrace_trace_function to __ftrace_trace_funcion before
    returning.
    
    Without this patch it is possible to execute an infinite recursion
    whereby ftrace_test_stop_func() calls __ftrace_trace_function,
    which was assigned ftrace_test_stop_func() in
    ftrace_update_pid_func().
    Signed-off-by: default avatarMatt Fleming <matthew.fleming@imgtec.com>
    Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    LKML-Reference: <1254152581-18347-1-git-send-email-matt@console-pimps.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    33974093
ftrace.c 68.6 KB