[Devel] [PATCH RHEL7 COMMIT] mm, kasan: don't call kasan_krealloc() from ksize().
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Sep 15 17:18:10 MSK 2017
The commit is pushed to "branch-rh7-3.10.0-693.1.1.vz7.37.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.1.1.vz7.37.4
------>
commit 9c3bc8b43df21819ed4d6acafb4408b0e93f49ef
Author: Alexander Potapenko <glider at google.com>
Date: Fri Sep 15 17:18:10 2017 +0300
mm, kasan: don't call kasan_krealloc() from ksize().
Instead of calling kasan_krealloc(), which replaces the memory
allocation stack ID (if stack depot is used), just unpoison the whole
memory chunk.
Signed-off-by: Alexander Potapenko <glider at google.com>
Acked-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
Cc: Andrey Konovalov <adech.fo at gmail.com>
Cc: Dmitry Vyukov <dvyukov at google.com>
Cc: Christoph Lameter <cl at linux.com>
Cc: Konstantin Serebryany <kcc at google.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
https://jira.sw.ru/browse/PSBM-69081
(cherry picked from commit 4ebb31a42ffa03912447fe1aabbdb28242f909ba)
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
mm/slab.c | 2 +-
mm/slub.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index ba35acc..7f5b2a3 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -4590,7 +4590,7 @@ size_t ksize(const void *objp)
/* We assume that ksize callers could use the whole allocated area,
* so we need to unpoison this area.
*/
- kasan_krealloc(objp, size, GFP_NOWAIT);
+ kasan_unpoison_shadow(objp, size);
return size;
}
diff --git a/mm/slub.c b/mm/slub.c
index e32920f..2a97b19 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3591,8 +3591,9 @@ size_t ksize(const void *object)
{
size_t size = __ksize(object);
/* We assume that ksize callers could use whole allocated area,
- so we need unpoison this area. */
- kasan_krealloc(object, size, GFP_NOWAIT);
+ * so we need to unpoison this area.
+ */
+ kasan_unpoison_shadow(object, size);
return size;
}
EXPORT_SYMBOL(ksize);
More information about the Devel
mailing list