]> git.baikalelectronics.ru Git - kernel.git/commit
kasan: separate double free case from invalid free
authorKuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Wed, 15 Jun 2022 06:22:18 +0000 (14:22 +0800)
committerakpm <akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:14:33 +0000 (17:14 -0700)
commit1862b7531cb611ea9e240c0aafdf217c811f86f7
tree088f7bc44ea4a7dfe21060ee870332f58d5565f9
parenta1a9b8289a39cc8d8c02e641644b2d95f482a77d
kasan: separate double free case from invalid free

Currently, KASAN describes all invalid-free/double-free bugs as
"double-free or invalid-free".  This is ambiguous.

KASAN should report "double-free" when a double-free is a more likely
cause (the address points to the start of an object) and report
"invalid-free" otherwise [1].

[1] https://bugzilla.kernel.org/show_bug.cgi?id=212193

Link: https://lkml.kernel.org/r/20220615062219.22618-1-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Yee Lee <yee.lee@mediatek.com>
Cc: Andrew Yang <andrew.yang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kasan/common.c
mm/kasan/kasan.h
mm/kasan/report.c