diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-10-04 03:34:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-05 15:08:14 -0400 |
commit | eaaea8036d0261d87d7072c5bc88c7ea730c18ac (patch) | |
tree | 07bbd53bdc9a47d86ca667f3171c3b7ebf1ac07c /kernel/futex.c | |
parent | d014e8894dfc523dd9d2f2a17b6dcb94facea810 (diff) |
futex: Fix locking imbalance
Rich reported a lock imbalance in the futex code:
http://bugzilla.kernel.org/show_bug.cgi?id=14288
It's caused by the displacement of the retry_private label in
futex_wake_op(). The code unlocks the hash bucket locks in the
error handling path and retries without locking them again which
makes the next unlock fail.
Move retry_private so we lock the hash bucket locks when we retry.
Reported-by: Rich Ercolany <rercola@acm.jhu.edu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Darren Hart <dvhltc@us.ibm.com>
Cc: stable-2.6.31 <stable@kernel.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 463af2efa512..1e176f3ab26c 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -916,8 +916,8 @@ retry: | |||
916 | hb1 = hash_futex(&key1); | 916 | hb1 = hash_futex(&key1); |
917 | hb2 = hash_futex(&key2); | 917 | hb2 = hash_futex(&key2); |
918 | 918 | ||
919 | double_lock_hb(hb1, hb2); | ||
920 | retry_private: | 919 | retry_private: |
920 | double_lock_hb(hb1, hb2); | ||
921 | op_ret = futex_atomic_op_inuser(op, uaddr2); | 921 | op_ret = futex_atomic_op_inuser(op, uaddr2); |
922 | if (unlikely(op_ret < 0)) { | 922 | if (unlikely(op_ret < 0)) { |
923 | 923 | ||