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/arm/include/asm | |
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/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/futex.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h index d20b78fce758..0e29d8e6a5c2 100644 --- a/arch/arm/include/asm/futex.h +++ b/arch/arm/include/asm/futex.h | |||
@@ -35,7 +35,7 @@ | |||
35 | : "cc", "memory") | 35 | : "cc", "memory") |
36 | 36 | ||
37 | static inline int | 37 | static inline int |
38 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 38 | futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) |
39 | { | 39 | { |
40 | int op = (encoded_op >> 28) & 7; | 40 | int op = (encoded_op >> 28) & 7; |
41 | int cmp = (encoded_op >> 24) & 15; | 41 | int cmp = (encoded_op >> 24) & 15; |
@@ -46,7 +46,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
46 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 46 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
47 | oparg = 1 << oparg; | 47 | oparg = 1 << oparg; |
48 | 48 | ||
49 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 49 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
50 | return -EFAULT; | 50 | return -EFAULT; |
51 | 51 | ||
52 | pagefault_disable(); /* implies preempt_disable() */ | 52 | pagefault_disable(); /* implies preempt_disable() */ |
@@ -88,12 +88,13 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
88 | } | 88 | } |
89 | 89 | ||
90 | static inline int | 90 | static inline int |
91 | futex_atomic_cmpxchg_inatomic(int *uval, int __user *uaddr, | 91 | futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
92 | int oldval, int newval) | 92 | u32 oldval, u32 newval) |
93 | { | 93 | { |
94 | int ret = 0, val; | 94 | int ret = 0; |
95 | u32 val; | ||
95 | 96 | ||
96 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 97 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
97 | return -EFAULT; | 98 | return -EFAULT; |
98 | 99 | ||
99 | /* Note that preemption is disabled by futex_atomic_cmpxchg_inatomic | 100 | /* Note that preemption is disabled by futex_atomic_cmpxchg_inatomic |