Makes the report easier to read.
Link: http://lkml.kernel.org/r/20170302134851.101218-10-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>
if (cache->flags & SLAB_KASAN) {
print_track(&alloc_info->alloc_track, "Allocated");
if (cache->flags & SLAB_KASAN) {
print_track(&alloc_info->alloc_track, "Allocated");
print_track(&alloc_info->free_track, "Freed");
print_track(&alloc_info->free_track, "Freed");
}
describe_object_addr(cache, object, addr);
}
describe_object_addr(cache, object, addr);
struct page *page = addr_to_page(addr);
dump_stack();
struct page *page = addr_to_page(addr);
dump_stack();
if (page && PageSlab(page)) {
struct kmem_cache *cache = page->slab_cache;
if (page && PageSlab(page)) {
struct kmem_cache *cache = page->slab_cache;
kasan_start_report(&flags);
pr_err("BUG: KASAN: double-free or invalid-free in %pS\n", ip);
kasan_start_report(&flags);
pr_err("BUG: KASAN: double-free or invalid-free in %pS\n", ip);
print_address_description(object);
print_address_description(object);
print_shadow_for_address(object);
kasan_end_report(&flags);
}
print_shadow_for_address(object);
kasan_end_report(&flags);
}
kasan_start_report(&flags);
print_error_description(info);
kasan_start_report(&flags);
print_error_description(info);
if (!addr_has_shadow(info)) {
dump_stack();
} else {
print_address_description((void *)info->access_addr);
if (!addr_has_shadow(info)) {
dump_stack();
} else {
print_address_description((void *)info->access_addr);
print_shadow_for_address(info->first_bad_addr);
}
print_shadow_for_address(info->first_bad_addr);
}