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-next>] [day] [month] [year] [list]
Message-Id: <200611282317.14020.jesper.juhl@gmail.com>
Date:	Tue, 28 Nov 2006 23:17:13 +0100
From:	Jesper Juhl <jesper.juhl@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Linus Torvalds <torvalds@...l.org>, Andrew Morton <akpm@...l.org>,
	trivial@...nel.org, Jesper Juhl <jesper.juhl@...il.com>
Subject: [PATCH] Don't compare unsigned variable for <0 in sys_prctl()


In kernel/sys.c::sys_prctl() the argument named 'arg2' is very clearly 
of type 'unsigned long', and when compiling with "gcc -W" gcc also warns :
  kernel/sys.c:2089: warning: comparison of unsigned expression < 0 is always false

So this patch removes the test of "arg2 < 0".

For those of us who compile their kernels with "-W" this gets rid of an 
annoying warning. For the rest of you it saves a few bytes of source code ;-)


Signed-off-by: Jesper Juhl <jesper.juhl@...il.com>
---

diff --git a/kernel/sys.c b/kernel/sys.c
index 98489d8..086ea37 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2086,7 +2086,7 @@ asmlinkage long sys_prctl(int option, un
 			error = current->mm->dumpable;
 			break;
 		case PR_SET_DUMPABLE:
-			if (arg2 < 0 || arg2 > 1) {
+			if (arg2 > 1) {
 				error = -EINVAL;
 				break;
 			}


-
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