From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by kanga.kvack.org (Postfix) with ESMTP id 859AB6B00C7 for ; Wed, 5 Nov 2014 09:54:39 -0500 (EST) Received: by mail-pa0-f49.google.com with SMTP id lj1so905296pab.36 for ; Wed, 05 Nov 2014 06:54:39 -0800 (PST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com. [210.118.77.13]) by mx.google.com with ESMTPS id xm9si3173041pbc.170.2014.11.05.06.54.37 for (version=TLSv1 cipher=RC4-MD5 bits=128/128); Wed, 05 Nov 2014 06:54:38 -0800 (PST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEK00AZKMVR1JB0@mailout3.w1.samsung.com> for linux-mm@kvack.org; Wed, 05 Nov 2014 14:57:27 +0000 (GMT) From: Andrey Ryabinin Subject: [PATCH v6 10/11] kmemleak: disable kasan instrumentation for kmemleak Date: Wed, 05 Nov 2014 17:54:00 +0300 Message-id: <1415199241-5121-11-git-send-email-a.ryabinin@samsung.com> In-reply-to: <1415199241-5121-1-git-send-email-a.ryabinin@samsung.com> References: <1404905415-9046-1-git-send-email-a.ryabinin@samsung.com> <1415199241-5121-1-git-send-email-a.ryabinin@samsung.com> Sender: owner-linux-mm@kvack.org List-ID: To: akpm@linux-foundation.org Cc: Andrey Ryabinin , Dmitry Vyukov , Konstantin Serebryany , Dmitry Chernenkov , Andrey Konovalov , Yuri Gribov , Konstantin Khlebnikov , Sasha Levin , Christoph Lameter , Joonsoo Kim , Dave Hansen , Andi Kleen , Vegard Nossum , "H. Peter Anvin" , Dave Jones , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Catalin Marinas 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: Andrey Ryabinin --- mm/kmemleak.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 3cda50c..9bda1b3 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -98,6 +98,7 @@ #include #include +#include #include #include #include @@ -1113,7 +1114,10 @@ static bool update_checksum(struct kmemleak_object *object) if (!kmemcheck_is_obj_initialized(object->pointer, object->size)) return false; + kasan_disable_local(); object->checksum = crc32(0, (void *)object->pointer, object->size); + kasan_enable_local(); + return object->checksum != old_csum; } @@ -1164,7 +1168,9 @@ static void scan_block(void *_start, void *_end, BYTES_PER_POINTER)) continue; + kasan_disable_local(); pointer = *ptr; + kasan_enable_local(); object = find_and_get_object(pointer, 1); if (!object) -- 2.1.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org