projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2dfd1bd
)
kasan: print virtual mapping info in reports
author
Andrey Konovalov
<andreyknvl@google.com>
Fri, 25 Mar 2022 01:12:11 +0000
(18:12 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Fri, 25 Mar 2022 02:06:48 +0000
(19:06 -0700)
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>
mm/kasan/report.c
patch
|
blob
|
blame
|
history
diff --git
a/mm/kasan/report.c
b/mm/kasan/report.c
index 137c2c0b09db687b248db0dd16652aa647838072..f64352008bb85f868f91fe3b2fe3b97a4dcee910 100644
(file)
--- a/
mm/kasan/report.c
+++ b/
mm/kasan/report.c
@@
-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 p
hysical p
age:\n");
dump_page(page, "kasan: bad access detected");
}