diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:23:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:23:52 -0400 |
commit | b80cd62b7d4406bbe8c573fe4381dcc71a2850fd (patch) | |
tree | b3fbd9dcaac45feefc554b5a46888b2cbec0c51d /arch/parisc | |
parent | c345f60a5f58a65004f22fb0d257d65ec1528310 (diff) | |
parent | 07d5ecae2940ddd77746e2fb597dcf57d3c2e277 (diff) |
Merge branch 'core-futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
arm: Remove bogus comment in futex_atomic_cmpxchg_inatomic()
futex: Deobfuscate handle_futex_death()
plist: Add priority list test
plist: Shrink struct plist_head
futex,plist: Remove debug lock assignment from plist_node
futex,plist: Pass the real head of the priority list to plist_del()
futex: Sanitize futex ops argument types
futex: Sanitize cmpxchg_futex_value_locked API
futex: Remove redundant pagefault_disable in futex_atomic_cmpxchg_inatomic()
futex: Avoid redudant evaluation of task_pid_vnr()
futex: Update futex_wait_setup comments about locking
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/include/asm/futex.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/parisc/include/asm/futex.h b/arch/parisc/include/asm/futex.h index 0c705c3a55ef..67a33cc27ef2 100644 --- a/arch/parisc/include/asm/futex.h +++ b/arch/parisc/include/asm/futex.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <asm/errno.h> | 8 | #include <asm/errno.h> |
9 | 9 | ||
10 | static inline int | 10 | static inline int |
11 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 11 | futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) |
12 | { | 12 | { |
13 | int op = (encoded_op >> 28) & 7; | 13 | int op = (encoded_op >> 28) & 7; |
14 | int cmp = (encoded_op >> 24) & 15; | 14 | int cmp = (encoded_op >> 24) & 15; |
@@ -18,7 +18,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
18 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 18 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
19 | oparg = 1 << oparg; | 19 | oparg = 1 << oparg; |
20 | 20 | ||
21 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | 21 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32))) |
22 | return -EFAULT; | 22 | return -EFAULT; |
23 | 23 | ||
24 | pagefault_disable(); | 24 | pagefault_disable(); |
@@ -51,10 +51,10 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
51 | 51 | ||
52 | /* Non-atomic version */ | 52 | /* Non-atomic version */ |
53 | static inline int | 53 | static inline int |
54 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 54 | futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
55 | u32 oldval, u32 newval) | ||
55 | { | 56 | { |
56 | int err = 0; | 57 | u32 val; |
57 | int uval; | ||
58 | 58 | ||
59 | /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is | 59 | /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is |
60 | * our gateway page, and causes no end of trouble... | 60 | * our gateway page, and causes no end of trouble... |
@@ -62,15 +62,15 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | |||
62 | if (segment_eq(KERNEL_DS, get_fs()) && !uaddr) | 62 | if (segment_eq(KERNEL_DS, get_fs()) && !uaddr) |
63 | return -EFAULT; | 63 | return -EFAULT; |
64 | 64 | ||
65 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 65 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
66 | return -EFAULT; | 66 | return -EFAULT; |
67 | 67 | ||
68 | err = get_user(uval, uaddr); | 68 | if (get_user(val, uaddr)) |
69 | if (err) return -EFAULT; | 69 | return -EFAULT; |
70 | if (uval == oldval) | 70 | if (val == oldval && put_user(newval, uaddr)) |
71 | err = put_user(newval, uaddr); | 71 | return -EFAULT; |
72 | if (err) return -EFAULT; | 72 | *uval = val; |
73 | return uval; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | #endif /*__KERNEL__*/ | 76 | #endif /*__KERNEL__*/ |