This is a note to let you know that I've just added the patch titled
kmemleak: Do not return a pointer to an object that kmemleak did not get
to the 2.6.39-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
kmemleak-do-not-return-a-pointer-to-an-object-that-kmemleak-did-not-get.patch
and it can be found in the queue-2.6.39 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 52c3ce4ec5601ee383a14f1485f6bac7b278896e Mon Sep 17 00:00:00 2001
From: Catalin Marinas <[email protected]>
Date: Wed, 27 Apr 2011 16:44:26 +0100
Subject: kmemleak: Do not return a pointer to an object that kmemleak did not
get
From: Catalin Marinas <[email protected]>
commit 52c3ce4ec5601ee383a14f1485f6bac7b278896e upstream.
The kmemleak_seq_next() function tries to get an object (and increment
its use count) before returning it. If it could not get the last object
during list traversal (because it may have been freed), the function
should return NULL rather than a pointer to such object that it did not
get.
Signed-off-by: Catalin Marinas <[email protected]>
Reported-by: Phil Carmody <[email protected]>
Acked-by: Phil Carmody <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
mm/kmemleak.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -1414,9 +1414,12 @@ static void *kmemleak_seq_next(struct se
++(*pos);
list_for_each_continue_rcu(n, &object_list) {
- next_obj = list_entry(n, struct kmemleak_object, object_list);
- if (get_object(next_obj))
+ struct kmemleak_object *obj =
+ list_entry(n, struct kmemleak_object, object_list);
+ if (get_object(obj)) {
+ next_obj = obj;
break;
+ }
}
put_object(prev_obj);
Patches currently in stable-queue which might be from [email protected]
are
queue-2.6.39/kmemleak-do-not-return-a-pointer-to-an-object-that-kmemleak-did-not-get.patch
queue-2.6.39/kmemleak-initialise-kmemleak-after-debug_objects_mem_init.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable