summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-06-25 00:50:07 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-06-25 03:23:52 +0300
commit5c335fe020ea287b2b49cc4dfca9f6756b88bb71 (patch)
tree06c106d7e217f9b2ae6c5e76ae9d636555f13f1e /mm
parentc8cc708a340cc7c5445565079fd4d1c28898d7a2 (diff)
downloadlinux-5c335fe020ea287b2b49cc4dfca9f6756b88bb71.tar.xz
mm: prevent KASAN false positives in kmemleak
When kmemleak dumps contents of leaked objects it reads whole objects regardless of user-requested size. This upsets KASAN. Disable KASAN checks around object dump. Link: http://lkml.kernel.org/r/1466617631-68387-1-git-send-email-dvyukov@google.com Signed-off-by: Dmitry Vyukov <dvyukov@google.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Alexander Potapenko <glider@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/kmemleak.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index e6429926e957..04320d3adbef 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -307,8 +307,10 @@ static void hex_dump_object(struct seq_file *seq,
len = min_t(size_t, object->size, HEX_MAX_LINES * HEX_ROW_SIZE);
seq_printf(seq, " hex dump (first %zu bytes):\n", len);
+ kasan_disable_current();
seq_hex_dump(seq, " ", DUMP_PREFIX_NONE, HEX_ROW_SIZE,
HEX_GROUP_SIZE, ptr, len, HEX_ASCII);
+ kasan_enable_current();
}
/*