[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-011ed56853e07e30653d6f1bfddc56b396218664@git.kernel.org>
Date: Sat, 21 Nov 2009 13:34:45 GMT
From: tip-bot for Li Zefan <lizf@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
stern@...land.harvard.edu, lizf@...fujitsu.com, fweisbec@...il.com,
rostedt@...dmis.org, tglx@...utronix.de, mingo@...e.hu,
prasad@...ux.vnet.ibm.com
Subject: [tip:perf/core] ksym_tracer: NIL-terminate user input filter
Commit-ID: 011ed56853e07e30653d6f1bfddc56b396218664
Gitweb: http://git.kernel.org/tip/011ed56853e07e30653d6f1bfddc56b396218664
Author: Li Zefan <lizf@...fujitsu.com>
AuthorDate: Tue, 7 Jul 2009 13:54:08 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 10 Jul 2009 11:59:42 +0200
ksym_tracer: NIL-terminate user input filter
Make sure the user input string is NULL-terminated.
Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: "K.Prasad" <prasad@...ux.vnet.ibm.com>
Cc: Alan Stern <stern@...land.harvard.edu>
Cc: Steven Rostedt <rostedt@...dmis.org>
LKML-Reference: <4A52E300.7020601@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/trace_ksym.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index 72fcb46..8cbed5a 100644
--- a/kernel/trace/trace_ksym.c
+++ b/kernel/trace/trace_ksym.c
@@ -264,11 +264,7 @@ static ssize_t ksym_trace_filter_write(struct file *file,
unsigned long ksym_addr = 0;
int ret, op, changed = 0;
- /* Ignore echo "" > ksym_trace_filter */
- if (count == 0)
- return 0;
-
- input_string = kzalloc(count, GFP_KERNEL);
+ input_string = kzalloc(count + 1, GFP_KERNEL);
if (!input_string)
return -ENOMEM;
@@ -276,6 +272,7 @@ static ssize_t ksym_trace_filter_write(struct file *file,
kfree(input_string);
return -EFAULT;
}
+ input_string[count] = '\0';
ret = op = parse_ksym_trace_str(input_string, &ksymname, &ksym_addr);
if (ret < 0) {
--
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