All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tracepoint: don't make assumptions about length of string on task rename
Date: Tue, 01 Sep 2015 11:07:32 -0400	[thread overview]
Message-ID: <55E5BF34.8080005@oracle.com> (raw)
In-Reply-To: <20150828110251.41b6b805@gandalf.local.home>

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


  reply	other threads:[~2015-09-01 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28 11:06 [PATCH] tracepoint: don't make assumptions about length of string on task rename Sasha Levin
2015-08-28 15:02 ` Steven Rostedt
2015-09-01 15:07   ` Sasha Levin [this message]
2015-09-01 15:32     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E5BF34.8080005@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.