UPSTREAM: 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 <andreyknvl@google.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Marco Elver <elver@google.com> Cc: Alexander Potapenko <glider@google.com> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Bug: 254721825 (cherry picked from commit c056a364e9546bd513d1f5205f0ee316d8acb910) Change-Id: I241a02aa0968cb32d77db041ae9b41a3d18ebc77 Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
This commit is contained in:
committed by
Todd Kjos
parent
d7045d5644
commit
a64ce821c0
@@ -251,8 +251,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