[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-92cf9f8f7e89c6bdbb1a724f879b8b18fc0dfe0f@git.kernel.org>
Date: Sat, 21 Nov 2009 13:34:33 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: Fix validation of length of access type
Commit-ID: 92cf9f8f7e89c6bdbb1a724f879b8b18fc0dfe0f
Gitweb: http://git.kernel.org/tip/92cf9f8f7e89c6bdbb1a724f879b8b18fc0dfe0f
Author: Li Zefan <lizf@...fujitsu.com>
AuthorDate: Tue, 7 Jul 2009 13:53:47 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 10 Jul 2009 11:59:42 +0200
ksym_tracer: Fix validation of length of access type
Don't take newline into account, otherwise:
# echo 'pid_max:-w-' > ksym_trace_filter
# echo -n 'pid_max:rw-' > ksym_trace_filter
bash: echo: write error: Invalid argument
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: <4A52E2EB.9070503@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/trace_ksym.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index 9556009..72fcb46 100644
--- a/kernel/trace/trace_ksym.c
+++ b/kernel/trace/trace_ksym.c
@@ -158,21 +158,21 @@ static int ksym_trace_get_access_type(char *str)
static int parse_ksym_trace_str(char *input_string, char **ksymname,
unsigned long *addr)
{
- char *delimiter = ":";
int ret;
- ret = -EINVAL;
- *ksymname = strsep(&input_string, delimiter);
+ strstrip(input_string);
+
+ *ksymname = strsep(&input_string, ":");
*addr = kallsyms_lookup_name(*ksymname);
/* Check for malformed request: (2), (1) and (5) */
if ((!input_string) ||
- (strlen(input_string) != (KSYM_TRACER_OP_LEN + 1)) ||
- (*addr == 0))
- goto return_code;
+ (strlen(input_string) != KSYM_TRACER_OP_LEN) ||
+ (*addr == 0))
+ return -EINVAL;;
+
ret = ksym_trace_get_access_type(input_string);
-return_code:
return ret;
}
--
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