From: Frederic Weisbecker <fweisbec@gmail.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [GIT PULL] tracing: Fix misuse of strncpy to copy boot params
Date: Thu, 15 Oct 2009 14:32:40 +0200 [thread overview]
Message-ID: <20091015123233.GB4960@nowhere> (raw)
In-Reply-To: <4AD68269.50701@cn.fujitsu.com>
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;
prev parent reply other threads:[~2009-10-15 12:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 20:38 [GIT PULL] tracing: Fix misuse of strncpy to copy boot params Frederic Weisbecker
2009-10-15 2:01 ` Li Zefan
2009-10-15 12:32 ` Frederic Weisbecker [this message]
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=20091015123233.GB4960@nowhere \
--to=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mingo@elte.hu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox