Skip to content

Commit

Permalink
kasan: print page description after stacks
Browse files Browse the repository at this point in the history
Moves page description after the stacks since it's less important.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Andrey Konovalov <[email protected]>
Acked-by: Dmitry Vyukov <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
xairy authored and torvalds committed May 3, 2017
1 parent 0c06f1f commit 430a05f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mm/kasan/report.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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");
}
}

Expand Down

0 comments on commit 430a05f

Please sign in to comment.