Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Sabyrzhan Tasbolatov and committed by
Andrew Morton
27109f57 cc22b997

+3 -8
+1 -1
mm/kasan/generic.c
··· 573 573 kasan_save_track(&alloc_meta->alloc_track, flags); 574 574 } 575 575 576 - void __kasan_save_free_info(struct kmem_cache *cache, void *object) 576 + void kasan_save_free_info(struct kmem_cache *cache, void *object) 577 577 { 578 578 struct kasan_free_meta *free_meta; 579 579
+1 -6
mm/kasan/kasan.h
··· 399 399 void kasan_save_track(struct kasan_track *track, gfp_t flags); 400 400 void kasan_save_alloc_info(struct kmem_cache *cache, void *object, gfp_t flags); 401 401 402 - void __kasan_save_free_info(struct kmem_cache *cache, void *object); 403 - static inline void kasan_save_free_info(struct kmem_cache *cache, void *object) 404 - { 405 - if (kasan_enabled()) 406 - __kasan_save_free_info(cache, object); 407 - } 402 + void kasan_save_free_info(struct kmem_cache *cache, void *object); 408 403 409 404 #ifdef CONFIG_KASAN_GENERIC 410 405 bool kasan_quarantine_put(struct kmem_cache *cache, void *object);
+1 -1
mm/kasan/tags.c
··· 142 142 save_stack_info(cache, object, flags, false); 143 143 } 144 144 145 - void __kasan_save_free_info(struct kmem_cache *cache, void *object) 145 + void kasan_save_free_info(struct kmem_cache *cache, void *object) 146 146 { 147 147 save_stack_info(cache, object, 0, true); 148 148 }