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

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

From: <hidden>
Date: 2021-09-30 03:50:32

September 29, 2021 8:45 PM, "Marco Elver" [off-list ref] wrote:
On Wed, 29 Sept 2021 at 14:42, Marco Elver [off-list ref] wrote:
quoted
On Wed, Sep 29, 2021 at 07:49PM -0400, yanjun.zhu@linux.dev wrote:
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.
@@ -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.
Follow your advice, I changed CONFIG_TRACING=n in .config. Then I run "make -jxx modules".
But CONFIG_TRACING is changed to y. 
So what you mentioned does not appear.

Zhu Yanjun
quoted
__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