lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1420421851-3281-3-git-send-email-iamjoonsoo.kim@lge.com>
Date:	Mon,  5 Jan 2015 10:37:27 +0900
From:	Joonsoo Kim <iamjoonsoo.kim@....com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Christoph Lameter <cl@...ux.com>,
	Pekka Enberg <penberg@...nel.org>,
	David Rientjes <rientjes@...gle.com>,
	Joonsoo Kim <iamjoonsoo.kim@....com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Jesper Dangaard Brouer <brouer@...hat.com>
Subject: [PATCH 2/6] mm/slab: remove kmemleak_erase() call

We already call kmemleak_no_scan() in initialization step of array cache,
so kmemleak doesn't scan array cache. Therefore, we don't need to call
kmemleak_erase() here.

And, this call is the last caller of kmemleak_erase(), so remove
kmemleak_erase() definition completely.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@....com>
---
 include/linux/kmemleak.h |    8 --------
 mm/slab.c                |   12 ------------
 2 files changed, 20 deletions(-)

diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
index e705467..8470733 100644
--- a/include/linux/kmemleak.h
+++ b/include/linux/kmemleak.h
@@ -52,11 +52,6 @@ static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags)
 		kmemleak_free(ptr);
 }
 
-static inline void kmemleak_erase(void **ptr)
-{
-	*ptr = NULL;
-}
-
 #else
 
 static inline void kmemleak_init(void)
@@ -98,9 +93,6 @@ static inline void kmemleak_ignore(const void *ptr)
 static inline void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp)
 {
 }
-static inline void kmemleak_erase(void **ptr)
-{
-}
 static inline void kmemleak_no_scan(const void *ptr)
 {
 }
diff --git a/mm/slab.c b/mm/slab.c
index 1150c8b..9aa58fc 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2942,20 +2942,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
 
 	STATS_INC_ALLOCMISS(cachep);
 	objp = cache_alloc_refill(cachep, flags, force_refill);
-	/*
-	 * the 'ac' may be updated by cache_alloc_refill(),
-	 * and kmemleak_erase() requires its correct value.
-	 */
-	ac = cpu_cache_get(cachep);
 
 out:
-	/*
-	 * To avoid a false negative, if an object that is in one of the
-	 * per-CPU caches is leaked, we need to make sure kmemleak doesn't
-	 * treat the array pointers as a reference to the object.
-	 */
-	if (objp)
-		kmemleak_erase(&ac->entry[ac->avail]);
 	return objp;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ