summaryrefslogtreecommitdiff
path: root/mm/kasan/report_generic.c
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2022-09-11 02:25:30 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-10-04 00:03:02 +0300
commitdcc579663f607392ade99a2301278239e819f57e (patch)
treee8f4b53dbd4747d25bc47dd9783a1d5def152651 /mm/kasan/report_generic.c
parentf7e01ab828fd4bf6d25b1f143a3994241e8572bf (diff)
downloadlinux-dcc579663f607392ade99a2301278239e819f57e.tar.xz
kasan: better invalid/double-free report header
Update the report header for invalid- and double-free bugs to contain the address being freed: BUG: KASAN: invalid-free in kfree+0x280/0x2a8 Free of addr ffff00000beac001 by task kunit_try_catch/99 Link: https://lkml.kernel.org/r/fce40f8dbd160972fe01a1ff39d0c426c310e4b7.1662852281.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Reviewed-by: Marco Elver <elver@google.com> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/kasan/report_generic.c')
-rw-r--r--mm/kasan/report_generic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/kasan/report_generic.c b/mm/kasan/report_generic.c
index 087c1d8c8145..043c94b04605 100644
--- a/mm/kasan/report_generic.c
+++ b/mm/kasan/report_generic.c
@@ -132,7 +132,8 @@ void kasan_complete_mode_report_info(struct kasan_report_info *info)
struct kasan_alloc_meta *alloc_meta;
struct kasan_free_meta *free_meta;
- info->bug_type = get_bug_type(info);
+ if (!info->bug_type)
+ info->bug_type = get_bug_type(info);
if (!info->cache || !info->object)
return;