linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] futex-fix-2.5.39-A1
@ 2002-09-29  9:56 Ingo Molnar
  0 siblings, 0 replies; only message in thread
From: Ingo Molnar @ 2002-09-29  9:56 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Rusty Russell


the attached patch fixes one more race left in the new futex hashing code,
which triggers if a futex waiter gets a signal after it has been woken up
but before it actually wakes up.

	Ingo

--- linux/kernel/futex.c.orig	Sun Sep 29 11:42:35 2002
+++ linux/kernel/futex.c	Sun Sep 29 11:48:16 2002
@@ -151,13 +151,13 @@
 	struct futex_q *q = container_of(vcache, struct futex_q, vcache);
 	struct list_head *head = hash_futex(new_page, q->offset);
 
-	BUG_ON(list_empty(&q->list));
-
 	spin_lock(&futex_lock);
 
-	q->page = new_page;
-	list_del_init(&q->list);
-	list_add_tail(&q->list, head);
+	if (!list_empty(&q->list)) {
+		q->page = new_page;
+		list_del(&q->list);
+		list_add_tail(&q->list, head);
+	}
 
 	spin_unlock(&futex_lock);
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-29  9:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-29  9:56 [patch] futex-fix-2.5.39-A1 Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).