[merged] kmemleak-protect-the-seq-start-next-stop-sequence-by-rcu_read_lock.patch removed from -mm tree

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

 



The patch titled
     kmemleak: protect the seq start/next/stop sequence by rcu_read_lock()
has been removed from the -mm tree.  Its filename was
     kmemleak-protect-the-seq-start-next-stop-sequence-by-rcu_read_lock.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: kmemleak: protect the seq start/next/stop sequence by rcu_read_lock()
From: Catalin Marinas <catalin.marinas@xxxxxxx>

Objects passed to kmemleak_seq_next() have an incremented reference count
(hence not freed) but they may point via object_list.next to other freed
objects.  To avoid this, the whole start/next/stop sequence must be
protected by rcu_read_lock().

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=13761

Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx>
Reported-by: Marton Nemeth <nm127@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/kmemleak.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff -puN mm/kmemleak.c~kmemleak-protect-the-seq-start-next-stop-sequence-by-rcu_read_lock mm/kmemleak.c
--- a/mm/kmemleak.c~kmemleak-protect-the-seq-start-next-stop-sequence-by-rcu_read_lock
+++ a/mm/kmemleak.c
@@ -1217,7 +1217,6 @@ static void *kmemleak_seq_start(struct s
 	}
 	object = NULL;
 out:
-	rcu_read_unlock();
 	return object;
 }
 
@@ -1233,13 +1232,11 @@ static void *kmemleak_seq_next(struct se
 
 	++(*pos);
 
-	rcu_read_lock();
 	list_for_each_continue_rcu(n, &object_list) {
 		next_obj = list_entry(n, struct kmemleak_object, object_list);
 		if (get_object(next_obj))
 			break;
 	}
-	rcu_read_unlock();
 
 	put_object(prev_obj);
 	return next_obj;
@@ -1255,6 +1252,7 @@ static void kmemleak_seq_stop(struct seq
 		 * kmemleak_seq_start may return ERR_PTR if the scan_mutex
 		 * waiting was interrupted, so only release it if !IS_ERR.
 		 */
+		rcu_read_unlock();
 		mutex_unlock(&scan_mutex);
 		if (v)
 			put_object(v);
_

Patches currently in -mm which might be from catalin.marinas@xxxxxxx are

origin.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux