Thread (13 messages) 13 messages, 6 authors, 2025-10-09

Re: [PATCH v6 1/2] kasan: introduce ARCH_DEFER_KASAN and unify static key across modes

From: Andrey Konovalov <andreyknvl@gmail.com>
Date: 2025-09-03 13:01:54
Also in: linux-arm-kernel, linux-mm, linux-riscv, linux-s390, linux-um, lkml, loongarch

On Wed, Sep 3, 2025 at 3:00 PM Andrey Konovalov [off-list ref] wrote:
quoted
+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);
+}
What I meant with these __wrappers was that we should add them for the
KASAN hooks that are called from non-KASAN code (i.e. for the hooks
defined in include/linux/kasan.h). And then move all the
kasan_enabled() checks from mm/kasan/* to where the wrappers are
defined in include/linux/kasan.h (see kasan_unpoison_range() as an
example).

kasan_save_free_info is a KASAN internal function that should need
such a wrapper.
... should _not_ need ...
For now, to make these patches simpler, you can keep kasan_enabled()
checks in mm/kasan/*, where they are now. Later we can move them to
include/linux/kasan.h with a separate patch.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help