Commit b1938599 authored by Andrey Konovalov's avatar Andrey Konovalov Committed by Linus Torvalds

kasan: separate report parts by empty lines

Makes the report easier to read.

Link: http://lkml.kernel.org/r/20170302134851.101218-10-andreyknvl@google.comSigned-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Acked-by: default avatarDmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5ab6d91a
...@@ -237,7 +237,9 @@ static void describe_object(struct kmem_cache *cache, void *object, ...@@ -237,7 +237,9 @@ static void describe_object(struct kmem_cache *cache, void *object,
if (cache->flags & SLAB_KASAN) { if (cache->flags & SLAB_KASAN) {
print_track(&alloc_info->alloc_track, "Allocated"); print_track(&alloc_info->alloc_track, "Allocated");
pr_err("\n");
print_track(&alloc_info->free_track, "Freed"); print_track(&alloc_info->free_track, "Freed");
pr_err("\n");
} }
describe_object_addr(cache, object, addr); describe_object_addr(cache, object, addr);
...@@ -248,6 +250,7 @@ static void print_address_description(void *addr) ...@@ -248,6 +250,7 @@ static void print_address_description(void *addr)
struct page *page = addr_to_page(addr); struct page *page = addr_to_page(addr);
dump_stack(); dump_stack();
pr_err("\n");
if (page && PageSlab(page)) { if (page && PageSlab(page)) {
struct kmem_cache *cache = page->slab_cache; struct kmem_cache *cache = page->slab_cache;
...@@ -326,7 +329,9 @@ void kasan_report_double_free(struct kmem_cache *cache, void *object, ...@@ -326,7 +329,9 @@ void kasan_report_double_free(struct kmem_cache *cache, void *object,
kasan_start_report(&flags); kasan_start_report(&flags);
pr_err("BUG: KASAN: double-free or invalid-free in %pS\n", ip); pr_err("BUG: KASAN: double-free or invalid-free in %pS\n", ip);
pr_err("\n");
print_address_description(object); print_address_description(object);
pr_err("\n");
print_shadow_for_address(object); print_shadow_for_address(object);
kasan_end_report(&flags); kasan_end_report(&flags);
} }
...@@ -338,11 +343,13 @@ static void kasan_report_error(struct kasan_access_info *info) ...@@ -338,11 +343,13 @@ static void kasan_report_error(struct kasan_access_info *info)
kasan_start_report(&flags); kasan_start_report(&flags);
print_error_description(info); print_error_description(info);
pr_err("\n");
if (!addr_has_shadow(info)) { if (!addr_has_shadow(info)) {
dump_stack(); dump_stack();
} else { } else {
print_address_description((void *)info->access_addr); print_address_description((void *)info->access_addr);
pr_err("\n");
print_shadow_for_address(info->first_bad_addr); print_shadow_for_address(info->first_bad_addr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment