mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
kasan: print virtual mapping info in reports
Print virtual mapping range and its creator in reports affecting virtual mappings. Also get physical page pointer for such mappings, so page information gets printed as well. Link: https://lkml.kernel.org/r/6ebb11210ae21253198e264d4bb0752c1fad67d7.1645548178.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Marco Elver <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Dmitriy Vyukov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
1 parent
2dfd1bd992
commit
c056a364e9
1 file changed
+14
-1
+14
-1
@@ -260,8 +260,21 @@ static void print_address_description(void *addr, u8 tag)
|
||||
pr_err(" %pS\n", addr);
|
||||
}
|
||||
|
||||
if (is_vmalloc_addr(addr)) {
|
||||
struct vm_struct *va = find_vm_area(addr);
|
||||
|
||||
if (va) {
|
||||
pr_err("The buggy address belongs to the virtual mapping at\n"
|
||||
" [%px, %px) created by:\n"
|
||||
" %pS\n",
|
||||
va->addr, va->addr + va->size, va->caller);
|
||||
|
||||
page = vmalloc_to_page(page);
|
||||
}
|
||||
}
|
||||
|
||||
if (page) {
|
||||
pr_err("The buggy address belongs to the page:\n");
|
||||
pr_err("The buggy address belongs to the physical page:\n");
|
||||
dump_page(page, "kasan: bad access detected");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user