Thread (6 messages) 6 messages, 3 authors, 2021-09-30

Re: [PATCH 1/1] mm/kasan: avoid export __kasan_kmalloc

From: Marco Elver <elver@google.com>
Date: 2021-09-29 12:45:33

On Wed, 29 Sept 2021 at 14:42, Marco Elver [off-list ref] wrote:
On Wed, Sep 29, 2021 at 07:49PM -0400, yanjun.zhu@linux.dev wrote:
quoted
From: Zhu Yanjun <redacted>

Since the function __kasan_kmalloc is only used in kasan module,
remove EXPORT_SYMBOL to this function.
This is incorrect, see below.
quoted
@@ -521,7 +521,6 @@ void * __must_check __kasan_kmalloc(struct kmem_cache *cache, const void *object
 {
      return ____kasan_kmalloc(cache, object, size, flags);
 }
-EXPORT_SYMBOL(__kasan_kmalloc);
Sorry, but this will break all users of kmalloc() with KASAN on if
!TRACING:
*module users.

An allmodconfig but with CONFIG_TRACING=n will probably show you the problem.
        __always_inline kmalloc() include/linux/slab.h
         -> __always_inline kmem_cache_alloc_trace() include/linux/slab.h
          -> __always_inline kasan_kmalloc() include/linux/kasan.h
           -> __kasan_kmalloc() mm/kasan/common.c
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help