From: Chen Gang Date: Fri, 22 Feb 2013 00:43:06 +0000 (-0800) Subject: sys_prctl(): arg2 is unsigned long which is never < 0 X-Git-Tag: upstream/snapshot3+hdmi~5683^2~108 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fe5e04292e71af34ae171b88caa2a139e0b6125;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git sys_prctl(): arg2 is unsigned long which is never < 0 arg2 will never < 0, for its type is 'unsigned long' Also, use the provided macros. Signed-off-by: Chen Gang Reported-by: Cyrill Gorcunov Acked-by: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sys.c b/kernel/sys.c index 265b376..8326105 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -47,6 +47,7 @@ #include #include #include +#include #include /* Move somewhere else to avoid recompiling? */ @@ -2026,7 +2027,8 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, error = get_dumpable(me->mm); break; case PR_SET_DUMPABLE: - if (arg2 < 0 || arg2 > 1) { + if (arg2 != SUID_DUMP_DISABLE && + arg2 != SUID_DUMP_USER) { error = -EINVAL; break; }