[patch 07/26] futex: fix requeue_pi key imbalance

From: Greg KH
Date: Fri Oct 09 2009 - 19:20:59 EST


2.6.31-stable review patch. If anyone has any objections, please let us know.

------------------
From: Darren Hart <dvhltc@xxxxxxxxxx>

commit da085681014fb43d67d9bf6d14bc068e9254bd49 upstream.

If futex_wait_requeue_pi() wakes prior to requeue, we drop the
reference to the source futex_key twice, once in
handle_early_requeue_pi_wakeup() and once on our way out.

Remove the drop from the handle_early_requeue_pi_wakeup() and keep
the get/drops together in futex_wait_requeue_pi().

Reported-by: Helge Bahmann <hcb@xxxxxxxxxxxxxxx>
Signed-off-by: Darren Hart <dvhltc@xxxxxxxxxx>
Cc: Helge Bahmann <hcb@xxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Cc: Dinakar Guniguntala <dino@xxxxxxxxxx>
Cc: John Stultz <johnstul@xxxxxxxxxx>
LKML-Reference: <4ACCE21E.5030805@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
kernel/futex.c | 1 -
1 file changed, 1 deletion(-)

--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2087,7 +2087,6 @@ int handle_early_requeue_pi_wakeup(struc
* Unqueue the futex_q and determine which it was.
*/
plist_del(&q->list, &q->list.plist);
- drop_futex_key_refs(&q->key);

if (timeout && !timeout->task)
ret = -ETIMEDOUT;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/