lkml.org 
[lkml]   [2010]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[03/11] tracing: Do not allow llseek to set_ftrace_filter
    2.6.27-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Steven Rostedt <srostedt@redhat.com>

    commit 9c55cb12c1c172e2d51e85fbb5a4796ca86b77e7 upstream.

    Reading the file set_ftrace_filter does three things.

    1) shows whether or not filters are set for the function tracer
    2) shows what functions are set for the function tracer
    3) shows what triggers are set on any functions

    3 is independent from 1 and 2.

    The way this file currently works is that it is a state machine,
    and as you read it, it may change state. But this assumption breaks
    when you use lseek() on the file. The state machine gets out of sync
    and the t_show() may use the wrong pointer and cause a kernel oops.

    Luckily, this will only kill the app that does the lseek, but the app
    dies while holding a mutex. This prevents anyone else from using the
    set_ftrace_filter file (or any other function tracing file for that matter).

    A real fix for this is to rewrite the code, but that is too much for
    a -rc release or stable. This patch simply disables llseek on the
    set_ftrace_filter() file for now, and we can do the proper fix for the
    next major release.

    Reported-by: Robert Swiecki <swiecki@google.com>
    Cc: Chris Wright <chrisw@sous-sol.org>
    Cc: Tavis Ormandy <taviso@google.com>
    Cc: Eugene Teo <eugene@redhat.com>
    Cc: vendor-sec@lst.de
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    kernel/trace/ftrace.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/kernel/trace/ftrace.c
    +++ b/kernel/trace/ftrace.c
    @@ -1456,7 +1456,7 @@ static struct file_operations ftrace_fil
    .open = ftrace_filter_open,
    .read = ftrace_regex_read,
    .write = ftrace_filter_write,
    - .llseek = ftrace_regex_lseek,
    + .llseek = no_llseek,
    .release = ftrace_filter_release,
    };




    \
     
     \ /
      Last update: 2010-09-18 20:53    [W:3.288 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site