Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ebb31a4 authored by Alexander Potapenko's avatar Alexander Potapenko Committed by Linus Torvalds
Browse files

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: default avatarAlexander Potapenko <glider@google.com>
Acked-by: default avatarAndrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrey Konovalov <adech.fo@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Konstantin Serebryany <kcc@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 55834c59
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4501,7 +4501,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;
}
+3 −2
Original line number Diff line number Diff line
@@ -3635,8 +3635,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);