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/tile/include | |
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/tile/include')
-rw-r--r-- | arch/tile/include/asm/futex.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/tile/include/asm/futex.h b/arch/tile/include/asm/futex.h index 664b20aa2584..d03ec124a598 100644 --- a/arch/tile/include/asm/futex.h +++ b/arch/tile/include/asm/futex.h | |||
@@ -29,16 +29,16 @@ | |||
29 | #include <linux/uaccess.h> | 29 | #include <linux/uaccess.h> |
30 | #include <linux/errno.h> | 30 | #include <linux/errno.h> |
31 | 31 | ||
32 | extern struct __get_user futex_set(int __user *v, int i); | 32 | extern struct __get_user futex_set(u32 __user *v, int i); |
33 | extern struct __get_user futex_add(int __user *v, int n); | 33 | extern struct __get_user futex_add(u32 __user *v, int n); |
34 | extern struct __get_user futex_or(int __user *v, int n); | 34 | extern struct __get_user futex_or(u32 __user *v, int n); |
35 | extern struct __get_user futex_andn(int __user *v, int n); | 35 | extern struct __get_user futex_andn(u32 __user *v, int n); |
36 | extern struct __get_user futex_cmpxchg(int __user *v, int o, int n); | 36 | extern struct __get_user futex_cmpxchg(u32 __user *v, int o, int n); |
37 | 37 | ||
38 | #ifndef __tilegx__ | 38 | #ifndef __tilegx__ |
39 | extern struct __get_user futex_xor(int __user *v, int n); | 39 | extern struct __get_user futex_xor(u32 __user *v, int n); |
40 | #else | 40 | #else |
41 | static inline struct __get_user futex_xor(int __user *uaddr, int n) | 41 | static inline struct __get_user futex_xor(u32 __user *uaddr, int n) |
42 | { | 42 | { |
43 | struct __get_user asm_ret = __get_user_4(uaddr); | 43 | struct __get_user asm_ret = __get_user_4(uaddr); |
44 | if (!asm_ret.err) { | 44 | if (!asm_ret.err) { |
@@ -53,7 +53,7 @@ static inline struct __get_user futex_xor(int __user *uaddr, int n) | |||
53 | } | 53 | } |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | 56 | static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) |
57 | { | 57 | { |
58 | int op = (encoded_op >> 28) & 7; | 58 | int op = (encoded_op >> 28) & 7; |
59 | int cmp = (encoded_op >> 24) & 15; | 59 | int cmp = (encoded_op >> 24) & 15; |
@@ -65,7 +65,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
65 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 65 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
66 | oparg = 1 << oparg; | 66 | oparg = 1 << oparg; |
67 | 67 | ||
68 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 68 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
69 | return -EFAULT; | 69 | return -EFAULT; |
70 | 70 | ||
71 | pagefault_disable(); | 71 | pagefault_disable(); |
@@ -119,12 +119,12 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
119 | return ret; | 119 | return ret; |
120 | } | 120 | } |
121 | 121 | ||
122 | static inline int futex_atomic_cmpxchg_inatomic(int *uval, int __user *uaddr, | 122 | static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
123 | int oldval, int newval) | 123 | u32 oldval, u32 newval) |
124 | { | 124 | { |
125 | struct __get_user asm_ret; | 125 | struct __get_user asm_ret; |
126 | 126 | ||
127 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 127 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
128 | return -EFAULT; | 128 | return -EFAULT; |
129 | 129 | ||
130 | asm_ret = futex_cmpxchg(uaddr, oldval, newval); | 130 | asm_ret = futex_cmpxchg(uaddr, oldval, newval); |