summaryrefslogtreecommitdiff
path: root/mm/kasan
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2017-05-03 14:56:44 -0700
committerPaul Lawrence <paullawrence@google.com>2017-12-14 08:25:54 -0800
commit35ea56c325fe692b16548e4797225067a5f97248 (patch)
tree0961d113ce867faa6d5a98c28be1a8ca19149ae8 /mm/kasan
parent500a7ed23b1ea1829beec72d73447a8001ec58ce (diff)
UPSTREAM: kasan: print page description after stacks
Moves page description after the stacks since it's less important. Link: http://lkml.kernel.org/r/20170302134851.101218-8-andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Acked-by: Dmitry Vyukov <dvyukov@google.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Alexander Potapenko <glider@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Bug: 64145065 (cherry-picked from 430a05f91d6051705a6ddbe207735ca62e39bb80) Change-Id: Ia20b7d6cf5602531072e9bd4fd478737f8623db1 Signed-off-by: Paul Lawrence <paullawrence@google.com>
Diffstat (limited to 'mm/kasan')
-rw-r--r--mm/kasan/report.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/kasan/report.c b/mm/kasan/report.c
index a1b1ef7a19f5..b015acc80876 100644
--- a/mm/kasan/report.c
+++ b/mm/kasan/report.c
@@ -261,9 +261,6 @@ static void print_address_description(struct kasan_access_info *info)
void *addr = (void *)info->access_addr;
struct page *page = addr_to_page(addr);
- if (page)
- dump_page(page, "kasan: bad access detected");
-
dump_stack();
if (page && PageSlab(page)) {
@@ -273,9 +270,14 @@ static void print_address_description(struct kasan_access_info *info)
describe_object(cache, object, addr);
}
- if (kernel_or_module_addr(addr)) {
- if (!init_task_stack_addr(addr))
- pr_err("Address belongs to variable %pS\n", addr);
+ if (kernel_or_module_addr(addr) && !init_task_stack_addr(addr)) {
+ pr_err("The buggy address belongs to the variable:\n");
+ pr_err(" %pS\n", addr);
+ }
+
+ if (page) {
+ pr_err("The buggy address belongs to the page:\n");
+ dump_page(page, "kasan: bad access detected");
}
}