mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
c8cc708a34
commit
5c335fe020
|
@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue