From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Li Zefan <lizf@cn.fujitsu.com>
Subject: [PATCH 3/4] ftrace: Copy ftrace_graph_filter boot param using strlcpy
Date: Wed, 14 Oct 2009 21:13:17 +0200 [thread overview]
Message-ID: <1255547598-5294-4-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1255547598-5294-1-git-send-email-fweisbec@gmail.com>
We are using strncpy in the wrong way to copy the ftrace_graph_filter
boot param because we pass the buffer size instead of the max string
size it can contain (buffer size - 1). The end result might not be
NULL terminated as we are abusing the max string size.
Lets use strlcpy() instead.
Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/ftrace.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index aaea9cd..b10c0d9 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2293,7 +2293,7 @@ __setup("ftrace_filter=", set_ftrace_filter);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
static int __init set_graph_function(char *str)
{
- strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
+ strlcpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
return 1;
}
__setup("ftrace_graph_filter=", set_graph_function);
--
1.6.2.3
next prev parent reply other threads:[~2009-10-14 19:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 19:13 [GIT PULL] tracing: Arch syscalls tracing shrinks and fixlets Frederic Weisbecker
2009-10-14 19:13 ` [PATCH 1/4] tracing: Move syscalls metadata handling from arch to core Frederic Weisbecker
2009-10-14 19:13 ` [PATCH 2/4] tracing: Document HAVE_SYSCALL_TRACEPOINTS needs Frederic Weisbecker
2009-10-14 19:13 ` Frederic Weisbecker [this message]
2009-10-14 19:13 ` [PATCH 4/4] ftrace: Rename set_bootup_ftrace into set_cmdline_ftrace Frederic Weisbecker
2009-10-15 6:40 ` [GIT PULL] tracing: Arch syscalls tracing shrinks and fixlets Ingo Molnar
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=1255547598-5294-4-git-send-email-fweisbec@gmail.com \
--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
all inboxes | Powered by JetHome®