Commit e79ed2f1 authored by Andrey Ryabinin's avatar Andrey Ryabinin Committed by Linus Torvalds
Browse files

kmemleak: disable kasan instrumentation for kmemleak

kmalloc internally round up allocation size, and kmemleak uses rounded up
size as object's size.  This makes kasan to complain while kmemleak scans
memory or calculates of object's checksum.  The simplest solution here is
to disable kasan.

Signed-off-by: default avatarAndrey Ryabinin <>
Acked-by: Catalin Marinas's avatarCatalin Marinas <>
Cc: Dmitry Vyukov <>
Cc: Konstantin Serebryany <>
Cc: Dmitry Chernenkov <>
Signed-off-by: default avatarAndrey Konovalov <>
Cc: Yuri Gribov <>
Cc: Konstantin Khlebnikov <>
Cc: Sasha Levin <>
Cc: Christoph Lameter <>
Cc: Joonsoo Kim <>
Cc: Dave Hansen <>
Cc: Andi Kleen <>
Cc: Ingo Molnar <>
Cc: Thomas Gleixner <>
Cc: "H. Peter Anvin" <>
Cc: Christoph Lameter <>
Cc: Pekka Enberg <>
Cc: David Rientjes <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent df4c0e36
......@@ -98,6 +98,7 @@
#include <asm/processor.h>
#include <linux/atomic.h>
#include <linux/kasan.h>
#include <linux/kmemcheck.h>
#include <linux/kmemleak.h>
#include <linux/memory_hotplug.h>
......@@ -1113,7 +1114,10 @@ static bool update_checksum(struct kmemleak_object *object)
if (!kmemcheck_is_obj_initialized(object->pointer, object->size))
return false;
object->checksum = crc32(0, (void *)object->pointer, object->size);
return object->checksum != old_csum;
......@@ -1164,7 +1168,9 @@ static void scan_block(void *_start, void *_end,
pointer = *ptr;
object = find_and_get_object(pointer, 1);
if (!object)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment