Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fe5e042 authored by Chen Gang's avatar Chen Gang Committed by Linus Torvalds
Browse files

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: default avatarChen Gang <gang.chen@asianux.com>
Reported-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 242260fb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#include <linux/syscalls.h>
#include <linux/kprobes.h>
#include <linux/user_namespace.h>
#include <linux/binfmts.h>

#include <linux/kmsg_dump.h>
/* 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;
			}