diff options
author | Michel Lespinasse <walken@google.com> | 2011-03-10 21:50:58 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-03-11 06:23:31 -0500 |
commit | 8d7718aa082aaf30a0b4989e1f04858952f941bc (patch) | |
tree | f006a565d138cec2b497c2bd619f570ad1a11f6e /arch/frv/kernel | |
parent | 37a9d912b24f96a0591773e6e6c3642991ae5a70 (diff) |
futex: Sanitize futex ops argument types
Change futex_atomic_op_inuser and futex_atomic_cmpxchg_inatomic
prototypes to use u32 types for the futex as this is the data type the
futex core code uses all over the place.
Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Darren Hart <darren@dvhart.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20110311025058.GD26122@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/frv/kernel')
-rw-r--r-- | arch/frv/kernel/futex.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/frv/kernel/futex.c b/arch/frv/kernel/futex.c index 14f64b054c7e..d155ca9e5098 100644 --- a/arch/frv/kernel/futex.c +++ b/arch/frv/kernel/futex.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * the various futex operations; MMU fault checking is ignored under no-MMU | 18 | * the various futex operations; MMU fault checking is ignored under no-MMU |
19 | * conditions | 19 | * conditions |
20 | */ | 20 | */ |
21 | static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, int *_oldval) | 21 | static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr, int *_oldval) |
22 | { | 22 | { |
23 | int oldval, ret; | 23 | int oldval, ret; |
24 | 24 | ||
@@ -50,7 +50,7 @@ static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, int *_o | |||
50 | return ret; | 50 | return ret; |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, int *_oldval) | 53 | static inline int atomic_futex_op_xchg_add(int oparg, u32 __user *uaddr, int *_oldval) |
54 | { | 54 | { |
55 | int oldval, ret; | 55 | int oldval, ret; |
56 | 56 | ||
@@ -83,7 +83,7 @@ static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, int *_o | |||
83 | return ret; | 83 | return ret; |
84 | } | 84 | } |
85 | 85 | ||
86 | static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, int *_oldval) | 86 | static inline int atomic_futex_op_xchg_or(int oparg, u32 __user *uaddr, int *_oldval) |
87 | { | 87 | { |
88 | int oldval, ret; | 88 | int oldval, ret; |
89 | 89 | ||
@@ -116,7 +116,7 @@ static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, int *_ol | |||
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, int *_oldval) | 119 | static inline int atomic_futex_op_xchg_and(int oparg, u32 __user *uaddr, int *_oldval) |
120 | { | 120 | { |
121 | int oldval, ret; | 121 | int oldval, ret; |
122 | 122 | ||
@@ -149,7 +149,7 @@ static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, int *_o | |||
149 | return ret; | 149 | return ret; |
150 | } | 150 | } |
151 | 151 | ||
152 | static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, int *_oldval) | 152 | static inline int atomic_futex_op_xchg_xor(int oparg, u32 __user *uaddr, int *_oldval) |
153 | { | 153 | { |
154 | int oldval, ret; | 154 | int oldval, ret; |
155 | 155 | ||
@@ -186,7 +186,7 @@ static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, int *_o | |||
186 | /* | 186 | /* |
187 | * do the futex operations | 187 | * do the futex operations |
188 | */ | 188 | */ |
189 | int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | 189 | int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) |
190 | { | 190 | { |
191 | int op = (encoded_op >> 28) & 7; | 191 | int op = (encoded_op >> 28) & 7; |
192 | int cmp = (encoded_op >> 24) & 15; | 192 | int cmp = (encoded_op >> 24) & 15; |
@@ -197,7 +197,7 @@ int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
197 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 197 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
198 | oparg = 1 << oparg; | 198 | oparg = 1 << oparg; |
199 | 199 | ||
200 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 200 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
201 | return -EFAULT; | 201 | return -EFAULT; |
202 | 202 | ||
203 | pagefault_disable(); | 203 | pagefault_disable(); |