summaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-02-21 16:43:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 17:22:20 -0800
commit7fe5e04292e71af34ae171b88caa2a139e0b6125 (patch)
tree5bae0bf98e77442626c61ad57d3121440d599f09 /kernel/sys.c
parent242260fb858e99674289484bc2bfe3b41f9c4cbb (diff)
downloadlinux-7fe5e04292e71af34ae171b88caa2a139e0b6125.tar.gz
linux-7fe5e04292e71af34ae171b88caa2a139e0b6125.tar.bz2
linux-7fe5e04292e71af34ae171b88caa2a139e0b6125.zip
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 <gang.chen@asianux.com> Reported-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 265b37690421..83261059676c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -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;
}