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/sparc | |
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/sparc')
-rw-r--r-- | arch/sparc/include/asm/futex_64.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc/include/asm/futex_64.h b/arch/sparc/include/asm/futex_64.h index e0862200d6a1..444e7bea23bc 100644 --- a/arch/sparc/include/asm/futex_64.h +++ b/arch/sparc/include/asm/futex_64.h | |||
@@ -30,7 +30,7 @@ | |||
30 | : "r" (uaddr), "r" (oparg), "i" (-EFAULT) \ | 30 | : "r" (uaddr), "r" (oparg), "i" (-EFAULT) \ |
31 | : "memory") | 31 | : "memory") |
32 | 32 | ||
33 | static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | 33 | static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) |
34 | { | 34 | { |
35 | int op = (encoded_op >> 28) & 7; | 35 | int op = (encoded_op >> 28) & 7; |
36 | int cmp = (encoded_op >> 24) & 15; | 36 | int cmp = (encoded_op >> 24) & 15; |
@@ -38,7 +38,7 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
38 | int cmparg = (encoded_op << 20) >> 20; | 38 | int cmparg = (encoded_op << 20) >> 20; |
39 | int oldval = 0, ret, tem; | 39 | int oldval = 0, ret, tem; |
40 | 40 | ||
41 | if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))) | 41 | if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))) |
42 | return -EFAULT; | 42 | return -EFAULT; |
43 | if (unlikely((((unsigned long) uaddr) & 0x3UL))) | 43 | if (unlikely((((unsigned long) uaddr) & 0x3UL))) |
44 | return -EINVAL; | 44 | return -EINVAL; |
@@ -85,8 +85,8 @@ static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | static inline int | 87 | static inline int |
88 | futex_atomic_cmpxchg_inatomic(int *uval, int __user *uaddr, | 88 | futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
89 | int oldval, int newval) | 89 | u32 oldval, u32 newval) |
90 | { | 90 | { |
91 | int ret = 0; | 91 | int ret = 0; |
92 | 92 | ||