Skip to content

Commit 340caf1

Browse files
Kuan-Ying Leetorvalds
authored andcommitted
kasan, slub: reset tag when printing address
The address still includes the tags when it is printed. With hardware tag-based kasan enabled, we will get a false positive KASAN issue when we access metadata. Reset the tag before we access the metadata. Link: https://lkml.kernel.org/r/[email protected] Fixes: aa1ef4d ("kasan, mm: reset tags when accessing metadata") Signed-off-by: Kuan-Ying Lee <[email protected]> Reviewed-by: Marco Elver <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chinwen Chang <[email protected]> Cc: Nicholas Tang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6c7a00b commit 340caf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/slub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ static void print_section(char *level, char *text, u8 *addr,
576576
unsigned int length)
577577
{
578578
metadata_access_enable();
579-
print_hex_dump(level, kasan_reset_tag(text), DUMP_PREFIX_ADDRESS,
580-
16, 1, addr, length, 1);
579+
print_hex_dump(level, text, DUMP_PREFIX_ADDRESS,
580+
16, 1, kasan_reset_tag((void *)addr), length, 1);
581581
metadata_access_disable();
582582
}
583583

0 commit comments

Comments
 (0)