mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 108/126] test_kmod: remove paranoid UINT_MAX check on uint range processing
@ 2017-09-08 23:16 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-09-08 23:16 UTC (permalink / raw)
  To: akpm, colin.king, dan.carpenter, dcb314, dmitry.torokhov,
	ebiederm, jeyu, jpoimboe, keescook, mbenes, mcgrof, mm-commits,
	mmarek, pmladek, rusty, shuah, torvalds

From: Dan Carpenter <dan.carpenter@oracle.com>
Subject: test_kmod: remove paranoid UINT_MAX check on uint range processing

The UINT_MAX comparison is not needed because "max" is already an unsigned
int, and we expect developer C code max value input to have a sensible 0 -
UINT_MAX range.  Note that if it so happens to be UINT_MAX + 1 it would
lead to an issue, but we expect the developer to know this.

[mcgrof@kernel.org: massaged commit log]
Link: http://lkml.kernel.org/r/20170802211707.28020-2-mcgrof@kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Jessica Yu <jeyu@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michal Marek <mmarek@suse.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: David Binderman <dcb314@hotmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/test_kmod.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN lib/test_kmod.c~test_kmod-remove-paranoid-uint_max-check-on-uint-range-processing lib/test_kmod.c
--- a/lib/test_kmod.c~test_kmod-remove-paranoid-uint_max-check-on-uint-range-processing
+++ a/lib/test_kmod.c
@@ -924,7 +924,7 @@ static int test_dev_config_update_uint_r
 	if (ret)
 		return ret;
 
-	if (new < min || new >  max || new > UINT_MAX)
+	if (new < min || new > max)
 		return -EINVAL;
 
 	mutex_lock(&test_dev->config_mutex);
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-08 23:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-08 23:16 [patch 108/126] test_kmod: remove paranoid UINT_MAX check on uint range processing akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).