lkml.org 
[lkml]   [2009]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 15/45] perf_counter: Fix buffer overflow in perf_copy_attr()
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>

    commit b3e62e35058fc744ac794611f4e79bcd1c5a4b83 upstream.

    If we pass a big size data over perf_counter_open() syscall,
    the kernel will copy this data to a small buffer, it will
    cause kernel crash.

    This bug makes the kernel unsafe and non-root local user can
    trigger it.

    Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
    Acked-by: Peter Zijlstra <peterz@infradead.org>
    Acked-by: Paul Mackerras <paulus@samba.org>
    LKML-Reference: <4AAF37D4.5010706@cn.fujitsu.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    kernel/perf_counter.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/kernel/perf_counter.c
    +++ b/kernel/perf_counter.c
    @@ -4171,6 +4171,7 @@ static int perf_copy_attr(struct perf_co
    if (val)
    goto err_size;
    }
    + size = sizeof(*attr);
    }

    ret = copy_from_user(attr, uattr, size);



    \
     
     \ /
      Last update: 2009-09-17 00:55    [W:0.021 / U:31.324 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site