public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] pi-futex: futex_wake() lockup fix
@ 2006-07-01  7:07 Ingo Molnar
  2006-07-01  7:23 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2006-07-01  7:07 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, Dave Jones, Thomas Gleixner, Ulrich Drepper

Subject: pi-futex: futex_wake() lockup fix
From: Ingo Molnar <mingo@elte.hu>

fix futex_wake() exit condition bug when handling the robust-list with 
PI futexes on them.

(reported by Ulrich Drepper, debugged by the lock validator.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/futex.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux/kernel/futex.c
===================================================================
--- linux.orig/kernel/futex.c
+++ linux/kernel/futex.c
@@ -646,8 +646,10 @@ static int futex_wake(u32 __user *uaddr,
 
 	list_for_each_entry_safe(this, next, head, list) {
 		if (match_futex (&this->key, &key)) {
-			if (this->pi_state)
-				return -EINVAL;
+			if (this->pi_state) {
+				ret = -EINVAL;
+				break;
+			}
 			wake_futex(this);
 			if (++ret >= nr_wake)
 				break;

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

end of thread, other threads:[~2006-07-01  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-01  7:07 [patch] pi-futex: futex_wake() lockup fix Ingo Molnar
2006-07-01  7:23 ` Andrew Morton
2006-07-01  7:25   ` Ingo Molnar

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