[patch] pi-futex: fix mm_struct memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Vernon Mauery <[email protected]>
Subject: pi-futex: fix mm_struct memory leak

lock_queue was getting called essentially twice in a row and was
continually incrementing the mm_count ref count, thus causing a
memory leak.

Dinakar Guniguntala provided a proper fix for the problem that simply 
grabs the spinlock for the hash bucket queue rather than calling 
lock_queue.

The second time we do a queue_lock in futex_lock_pi, we really only need 
to take the hash bucket lock.

Signed-off-by: Dinakar Guniguntala <[email protected]>
Signed-off-by: Vernon Mauery <[email protected]>
Acked-by: Paul E. McKenney <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
 kernel/futex.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/kernel/futex.c
===================================================================
--- linux.orig/kernel/futex.c
+++ linux/kernel/futex.c
@@ -1208,7 +1208,7 @@ static int do_futex_lock_pi(u32 __user *
 	}
 
 	down_read(&curr->mm->mmap_sem);
-	hb = queue_lock(&q, -1, NULL);
+	spin_lock(q.lock_ptr);
 
 	/*
 	 * Got the lock. We might not be the anticipated owner if we
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux