mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] futex: fix requeue_pi key imbalance
@ 2009-10-07 18:46 Darren Hart
  2009-10-07 19:25 ` [tip:core/urgent] " tip-bot for Darren Hart
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Hart @ 2009-10-07 18:46 UTC (permalink / raw)
  To: lkml, 
  Cc: Helge Bahmann, Thomas Gleixner, Peter Zijlstra, Ingo Molnar,
	Eric Dumazet, Dinakar Guniguntala, John Stultz

futex: fix requeue_pi key imbalance

From: Darren Hart <dvhltc@us.ibm.com>

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@chaoticmind.net>
Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Dinakar Guniguntala <dino@in.ibm.com>
CC: John Stultz <johnstul@us.ibm.com>
---

 kernel/futex.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


Index: linux-2.6.git/kernel/futex.c
===================================================================
--- linux-2.6.git.orig/kernel/futex.c
+++ linux-2.6.git/kernel/futex.c
@@ -2117,7 +2117,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;
-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:core/urgent] futex: fix requeue_pi key imbalance
  2009-10-07 18:46 [PATCH] futex: fix requeue_pi key imbalance Darren Hart
@ 2009-10-07 19:25 ` tip-bot for Darren Hart
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Darren Hart @ 2009-10-07 19:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, dvhltc, hpa, mingo, eric.dumazet, johnstul, peterz,
	dino, hcb, stable, tglx

Commit-ID:  da085681014fb43d67d9bf6d14bc068e9254bd49
Gitweb:     http://git.kernel.org/tip/da085681014fb43d67d9bf6d14bc068e9254bd49
Author:     Darren Hart <dvhltc@us.ibm.com>
AuthorDate: Wed, 7 Oct 2009 11:46:54 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 7 Oct 2009 21:22:03 +0200

futex: fix requeue_pi key imbalance

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@chaoticmind.net>
Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Cc: Helge Bahmann <hcb@chaoticmind.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dinakar Guniguntala <dino@in.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: stable-2.6.31 <stable@kernel.org>
LKML-Reference: <4ACCE21E.5030805@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/futex.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index 1e176f3..c3bb2fc 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -2111,7 +2111,6 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
 		 * 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-07 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-07 18:46 [PATCH] futex: fix requeue_pi key imbalance Darren Hart
2009-10-07 19:25 ` [tip:core/urgent] " tip-bot for Darren Hart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome