mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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/[email protected] Signed-off-by: Dmitry Vyukov <[email protected]> Acked-by: Catalin Marinas <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Alexander Potapenko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
committed by
Linus Torvalds
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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user