diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-02-21 19:43:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:20 -0500 |
commit | 7fe5e04292e71af34ae171b88caa2a139e0b6125 (patch) | |
tree | 5bae0bf98e77442626c61ad57d3121440d599f09 /kernel | |
parent | 242260fb858e99674289484bc2bfe3b41f9c4cbb (diff) |
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')
-rw-r--r-- | kernel/sys.c | 4 |
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 @@ | |||
47 | #include <linux/syscalls.h> | 47 | #include <linux/syscalls.h> |
48 | #include <linux/kprobes.h> | 48 | #include <linux/kprobes.h> |
49 | #include <linux/user_namespace.h> | 49 | #include <linux/user_namespace.h> |
50 | #include <linux/binfmts.h> | ||
50 | 51 | ||
51 | #include <linux/kmsg_dump.h> | 52 | #include <linux/kmsg_dump.h> |
52 | /* Move somewhere else to avoid recompiling? */ | 53 | /* Move somewhere else to avoid recompiling? */ |
@@ -2026,7 +2027,8 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, | |||
2026 | error = get_dumpable(me->mm); | 2027 | error = get_dumpable(me->mm); |
2027 | break; | 2028 | break; |
2028 | case PR_SET_DUMPABLE: | 2029 | case PR_SET_DUMPABLE: |
2029 | if (arg2 < 0 || arg2 > 1) { | 2030 | if (arg2 != SUID_DUMP_DISABLE && |
2031 | arg2 != SUID_DUMP_USER) { | ||
2030 | error = -EINVAL; | 2032 | error = -EINVAL; |
2031 | break; | 2033 | break; |
2032 | } | 2034 | } |