lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291571382-2719-5-git-send-email-adobriyan@gmail.com>
Date:	Sun,  5 Dec 2010 19:49:02 +0200
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, Alexey Dobriyan <adobriyan@...il.com>
Subject: [PATCH 05/45] kstrtox: kernel/trace/


Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---
 kernel/trace/ftrace.c              |    6 +++---
 kernel/trace/ring_buffer.c         |    2 +-
 kernel/trace/trace.c               |   16 ++++++++--------
 kernel/trace/trace_events.c        |    8 ++++----
 kernel/trace/trace_events_filter.c |    4 ++--
 kernel/trace/trace_functions.c     |    4 ++--
 kernel/trace/trace_kprobe.c        |   25 ++++++++++++-------------
 kernel/trace/trace_stack.c         |    4 ++--
 8 files changed, 34 insertions(+), 35 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f3dadae..537fd31 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -747,7 +747,7 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -3053,7 +3053,7 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
 		   size_t cnt, loff_t *ppos)
 {
 	char buf[64], *tmp;
-	long val;
+	int val;
 	int ret;
 
 	if (cnt >= sizeof(buf))
@@ -3072,7 +3072,7 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
 	if (strlen(tmp) == 0)
 		return 1;
 
-	ret = strict_strtol(tmp, 10, &val);
+	ret = kstrtoint(tmp, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 9ed509a..9ad99a6 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -3965,7 +3965,7 @@ rb_simple_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c380612..8509b20 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -389,7 +389,7 @@ static int __init set_tracing_thresh(char *str)
 
 	if (!str)
 		return 0;
-	ret = strict_strtoul(str, 0, &threshhold);
+	ret = kstrtoul(str, 0, &threshhold);
 	if (ret < 0)
 		return 0;
 	tracing_thresh = threshhold * 1000;
@@ -2696,7 +2696,7 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -2957,7 +2957,7 @@ tracing_max_lat_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -3416,7 +3416,7 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -4069,7 +4069,7 @@ trace_options_write(struct file *filp, const char __user *ubuf, size_t cnt,
 			 loff_t *ppos)
 {
 	struct trace_option_dentry *topt = filp->private_data;
-	unsigned long val;
+	unsigned int val;
 	char buf[64];
 	int ret;
 
@@ -4081,7 +4081,7 @@ trace_options_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtouint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -4131,7 +4131,7 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
 {
 	long index = (long)filp->private_data;
 	char buf[64];
-	unsigned long val;
+	unsigned int val;
 	int ret;
 
 	if (cnt >= sizeof(buf))
@@ -4142,7 +4142,7 @@ trace_options_core_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtouint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 0725eea..c7039a2 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -480,7 +480,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 {
 	struct ftrace_event_call *call = filp->private_data;
 	char buf[64];
-	unsigned long val;
+	int val;
 	int ret;
 
 	if (cnt >= sizeof(buf))
@@ -491,7 +491,7 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
@@ -563,8 +563,8 @@ system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 		    loff_t *ppos)
 {
 	const char *system = filp->private_data;
-	unsigned long val;
 	char buf[64];
+	int val;
 	ssize_t ret;
 
 	if (cnt >= sizeof(buf))
@@ -575,7 +575,7 @@ system_enable_write(struct file *filp, const char __user *ubuf, size_t cnt,
 
 	buf[cnt] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoint(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 36d4010..f17f6a0 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -807,9 +807,9 @@ static int filter_add_pred(struct filter_parse_state *ps,
 			fn = filter_pred_pchar;
 	} else {
 		if (field->is_signed)
-			ret = strict_strtoll(pred->regex.pattern, 0, &val);
+			ret = kstrtoll(pred->regex.pattern, 0, &val);
 		else
-			ret = strict_strtoull(pred->regex.pattern, 0, &val);
+			ret = kstrtoull(pred->regex.pattern, 0, &val);
 		if (ret) {
 			parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0);
 			return -EINVAL;
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 16aee4d..2f0dab3 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -354,8 +354,8 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable)
 	 * We use the callback data field (which is a pointer)
 	 * as our counter.
 	 */
-	ret = strict_strtoul(number, 0, (unsigned long *)&count);
-	if (ret)
+	ret = kstrtoul(number, 0, (unsigned long *)&count);
+	if (ret < 0)
 		return ret;
 
  out_reg:
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 2dec9bc..e29849d 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -684,9 +684,8 @@ static int split_symbol_offset(char *symbol, unsigned long *offset)
 
 	tmp = strchr(symbol, '+');
 	if (tmp) {
-		/* skip sign because strict_strtol doesn't accept '+' */
-		ret = strict_strtoul(tmp + 1, 0, offset);
-		if (ret)
+		ret = kstrtoul(tmp, 0, offset);
+		if (ret < 0)
 			return ret;
 		*tmp = '\0';
 	} else
@@ -715,8 +714,10 @@ static int parse_probe_vars(char *arg, const struct fetch_type *t,
 			else
 				ret = -EINVAL;
 		} else if (isdigit(arg[5])) {
-			ret = strict_strtoul(arg + 5, 10, &param);
-			if (ret || param > PARAM_MAX_STACK)
+			ret = kstrtoul(arg + 5, 10, &param);
+			if (ret < 0)
+				return ret;
+			if (param > PARAM_MAX_STACK)
 				ret = -EINVAL;
 			else {
 				f->fn = t->fetch[FETCH_MTD_stack];
@@ -752,8 +753,8 @@ static int __parse_probe_arg(char *arg, const struct fetch_type *t,
 		break;
 	case '@':	/* memory or symbol */
 		if (isdigit(arg[1])) {
-			ret = strict_strtoul(arg + 1, 0, &param);
-			if (ret)
+			ret = kstrtoul(arg + 1, 0, &param);
+			if (ret < 0)
 				break;
 			f->fn = t->fetch[FETCH_MTD_memory];
 			f->data = (void *)param;
@@ -772,11 +773,9 @@ static int __parse_probe_arg(char *arg, const struct fetch_type *t,
 		if (!tmp)
 			break;
 		*tmp = '\0';
-		ret = strict_strtol(arg + 1, 0, &offset);
-		if (ret)
+		ret = kstrtol(arg, 0, &offset);
+		if (ret < 0)
 			break;
-		if (arg[0] == '-')
-			offset = -offset;
 		arg = tmp + 1;
 		tmp = strrchr(arg, ')');
 		if (tmp) {
@@ -948,8 +947,8 @@ static int create_trace_probe(int argc, char **argv)
 			return -EINVAL;
 		}
 		/* an address specified */
-		ret = strict_strtoul(&argv[1][0], 0, (unsigned long *)&addr);
-		if (ret) {
+		ret = kstrtoul(&argv[1][0], 0, (unsigned long *)&addr);
+		if (ret < 0) {
 			pr_info("Failed to parse address.\n");
 			return ret;
 		}
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 4c5dead..36ebd3b 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -153,7 +153,7 @@ static ssize_t
 stack_max_size_write(struct file *filp, const char __user *ubuf,
 		     size_t count, loff_t *ppos)
 {
-	long *ptr = filp->private_data;
+	unsigned long *ptr = filp->private_data;
 	unsigned long val, flags;
 	char buf[64];
 	int ret;
@@ -167,7 +167,7 @@ stack_max_size_write(struct file *filp, const char __user *ubuf,
 
 	buf[count] = 0;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret < 0)
 		return ret;
 
-- 
1.7.2.2

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ