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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 01 Mar 2009 21:55:42 +0100
From:	Roel Kluin <roel.kluin@...il.com>
To:	Steven Rostedt <rostedt@...dmis.org>
CC:	lkml <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] ftrace: '< 0' test on unsigned

or should this be fixed, with

        if (!cnt || cnt > DEFINE)

if so, what should DEFINE be?

This patch wasn't tested in any way.
------------------------------>8-------------8<---------------------------------
cnt is unsigned, so the '< 0' test won't work.

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index fdf913d..6dab415 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1129,7 +1129,7 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
 	size_t read = 0;
 	ssize_t ret;
 
-	if (!cnt || cnt < 0)
+	if (!cnt || (ssize_t)cnt < 0)
 		return 0;
 
 	mutex_lock(&ftrace_regex_lock);

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