mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
kasan: remove __kasan_save_free_info wrapper
Patch series "kasan: cleanups for kasan_enabled() checks". This patch series is the continuation of [1] the previous discussion related to the KASAN internal refactoring. Here we remove kasan_enabled() checks which are duplicated by higher callers. These checks deduplication are also related to the separate patch series [2]. This patch (of 2): We don't need a kasan_enabled() check in kasan_save_free_info() at all. Both the higher level paths (kasan_slab_free and kasan_mempool_poison_object) already contain this check. Therefore, remove the __wrapper. Link: https://lkml.kernel.org/r/20251009155403.1379150-1-snovitoll@gmail.com Link: https://lkml.kernel.org/r/20251009155403.1379150-2-snovitoll@gmail.com Link: https://lore.kernel.org/all/CA+fCnZce3AR+pUesbDkKMtMJ+iR8eDrcjFTbVpAcwjBoZ=gJnQ@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/aNTfPjS2buXMI46D@MiWiFi-R3L-srv/ [2] Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com> Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com> Cc: Alexander Potapenko <glider@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Baoquan He <bhe@redhat.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com> Cc: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
cc22b99785
commit
27109f5703
@@ -573,7 +573,7 @@ void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags)
|
||||
kasan_save_track(&alloc_meta->alloc_track, flags);
|
||||
}
|
||||
|
||||
void __kasan_save_free_info(struct kmem_cache *cache, void *object)
|
||||
void kasan_save_free_info(struct kmem_cache *cache, void *object)
|
||||
{
|
||||
struct kasan_free_meta *free_meta;
|
||||
|
||||
|
||||
@@ -399,12 +399,7 @@ void kasan_set_track(struct kasan_track *track, depot_stack_handle_t stack);
|
||||
void kasan_save_track(struct kasan_track *track, gfp_t flags);
|
||||
void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags);
|
||||
|
||||
void __kasan_save_free_info(struct kmem_cache *cache, void *object);
|
||||
static inline void kasan_save_free_info(struct kmem_cache *cache, void *object)
|
||||
{
|
||||
if (kasan_enabled())
|
||||
__kasan_save_free_info(cache, object);
|
||||
}
|
||||
void kasan_save_free_info(struct kmem_cache *cache, void *object);
|
||||
|
||||
#ifdef CONFIG_KASAN_GENERIC
|
||||
bool kasan_quarantine_put(struct kmem_cache *cache, void *object);
|
||||
|
||||
@@ -142,7 +142,7 @@ void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags)
|
||||
save_stack_info(cache, object, flags, false);
|
||||
}
|
||||
|
||||
void __kasan_save_free_info(struct kmem_cache *cache, void *object)
|
||||
void kasan_save_free_info(struct kmem_cache *cache, void *object)
|
||||
{
|
||||
save_stack_info(cache, object, 0, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user