lkml.org 
[lkml]   [2009]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateThu, 15 Oct 2009 14:32:40 +0200
FromFrederic Weisbecker <>
SubjectRe: [GIT PULL] tracing: Fix misuse of strncpy to copy boot params
On Thu, Oct 15, 2009 at 10:01:13AM +0800, Li Zefan wrote:
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index 4506826..621d81e 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -131,7 +131,7 @@ static char *default_bootup_tracer;
> >
> > static int __init set_ftrace(char *str)
> > {
> > - strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
> > + strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
>
> Actually using strncpy() here is fine.
>
> See how the str buf is used:
>
> int register_tracer(struct tracer *type)
> {
> ...
> if (strncmp(default_bootup_tracer, type->name, MAX_TRACER_SIZE))
> ...
> }



Yeah. I can remove the change for this buffer and send
another pull request.

Thanks.


> > default_bootup_tracer = bootup_tracer_buf;
> > /* We are using ftrace early, expand it */
> > ring_buffer_expanded = 1;



\
 
 \ /
  Last update: 2009-10-15 14:43    [from the cache]
©2003-2010