[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091015123233.GB4960@nowhere>
Date: Thu, 15 Oct 2009 14:32:40 +0200
From: Frederic Weisbecker <fweisbec@...il.com>
To: Li Zefan <lizf@...fujitsu.com>
Cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists