WSL2-Linux-Kernel/mm/kasan
Feng Tang bbc61844b4 mm/kasan: simplify and refine kasan_cache code
struct 'kasan_cache' has a member 'is_kmalloc' indicating whether its host
kmem_cache is a kmalloc cache.  With newly introduced is_kmalloc_cache()
helper, 'is_kmalloc' and its related function can be replaced and removed.

Also 'kasan_cache' is only needed by KASAN generic mode, and not by SW/HW
tag modes, so refine its protection macro accordingly, suggested by Andrey
Konoval.

Link: https://lkml.kernel.org/r/20230104060605.930910-2-feng.tang@intel.com
Signed-off-by: Feng Tang <feng.tang@intel.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-01-18 17:12:55 -08:00
..
Makefile kasan: move tests to mm/kasan/ 2022-10-03 14:03:02 -07:00
common.c mm/kasan: simplify and refine kasan_cache code 2023-01-18 17:12:55 -08:00
generic.c mm: kasan: Extend kasan_metadata_size() to also cover in-object size 2022-11-10 16:27:46 +01:00
hw_tags.c kasan: allow sampling page_alloc allocations for HW_TAGS 2023-01-18 17:12:45 -08:00
init.c
kasan.h kasan: allow sampling page_alloc allocations for HW_TAGS 2023-01-18 17:12:45 -08:00
kasan_test.c hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
kasan_test_module.c kasan: migrate workqueue_uaf test to kunit 2022-11-08 17:37:14 -08:00
quarantine.c
report.c kasan: mark kasan_kunit_executing as static 2023-01-11 16:14:21 -08:00
report_generic.c kasan: better invalid/double-free report header 2022-10-03 14:03:02 -07:00
report_hw_tags.c
report_sw_tags.c
report_tags.c kasan: better invalid/double-free report header 2022-10-03 14:03:02 -07:00
shadow.c memory: move hotplug memory notifier priority to same file for easy sorting 2022-11-08 17:37:17 -08:00
sw_tags.c kasan: support kasan.stacktrace for SW_TAGS 2022-10-03 14:03:01 -07:00
tags.c kasan: dynamically allocate stack ring entries 2022-10-03 14:03:02 -07:00