lkml.org 
[lkml]   [2015]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] tracepoint: don't make assumptions about length of string on task rename
    On 08/28/2015 11:02 AM, Steven Rostedt wrote:
    > On Fri, 28 Aug 2015 07:06:58 -0400
    > Sasha Levin <sasha.levin@oracle.com> wrote:
    >
    >> While the dest comm string size is assured to be at least TASK_COMM_LEN long,
    >> doing a memcpy() also adds the assumption that the source is at least that
    >> long as well, which isn't assured, and isn't true in cases such as:
    >>
    >> set_task_comm(worker->task, "kworker/dying");
    >>
    >> This leads to accessing invalid memory.
    >>
    >> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
    >
    > Acked-by: Steven Rostedt <rostedt@goodmis.org>
    >
    > Should this go to stable as well?

    Yup.

    > Also, as the memcpy was just faster than a strcpy, the static length
    > was used. Perhaps we should convert that to a dynamic length string.
    > But that should be a separate patch as this one fixes a possible bug,
    > and the conversion to a dynamic string is just an enhancement.

    That'll slow things down for the common case, no?


    Thanks,
    Sasha



    \
     
     \ /
      Last update: 2015-09-01 17:21    [W:7.659 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site