[PATCH] ARM: export __memset/__memcpy/__memmove

Arnd Bergmann posted 1 patch 3 months, 2 weeks ago
arch/arm/kernel/armksyms.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] ARM: export __memset/__memcpy/__memmove
Posted by Arnd Bergmann 3 months, 2 weeks ago
From: Arnd Bergmann <arnd@arndb.de>

When KASAN is locally disabled for one file, the string functions
get redirected to internal helpers, but those are not actually exported,
so this only works in built-in code but fails for loadable modules:

ERROR: modpost: "__memset" [crypto/ecc.ko] undefined!
ERROR: modpost: "__memcpy" [crypto/ecc.ko] undefined!

Add the missig exports.

Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/kernel/armksyms.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 82e96ac83684..1ff50106afa4 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -83,10 +83,13 @@ EXPORT_SYMBOL(__raw_writesl);
 EXPORT_SYMBOL(strchr);
 EXPORT_SYMBOL(strrchr);
 EXPORT_SYMBOL(memset);
+EXPORT_SYMBOL(__memset);
 EXPORT_SYMBOL(__memset32);
 EXPORT_SYMBOL(__memset64);
 EXPORT_SYMBOL(memcpy);
+EXPORT_SYMBOL(__memcpy);
 EXPORT_SYMBOL(memmove);
+EXPORT_SYMBOL(__memmove);
 EXPORT_SYMBOL(memchr);
 
 EXPORT_SYMBOL(mmioset);
-- 
2.39.5
Re: [PATCH] ARM: export __memset/__memcpy/__memmove
Posted by Ahmad Fatoum 3 months, 2 weeks ago
On 20.06.25 13:12, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When KASAN is locally disabled for one file, the string functions
> get redirected to internal helpers, but those are not actually exported,
> so this only works in built-in code but fails for loadable modules:
> 
> ERROR: modpost: "__memset" [crypto/ecc.ko] undefined!
> ERROR: modpost: "__memcpy" [crypto/ecc.ko] undefined!
> 
> Add the missig exports.
> 
> Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  arch/arm/kernel/armksyms.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
> index 82e96ac83684..1ff50106afa4 100644
> --- a/arch/arm/kernel/armksyms.c
> +++ b/arch/arm/kernel/armksyms.c
> @@ -83,10 +83,13 @@ EXPORT_SYMBOL(__raw_writesl);
>  EXPORT_SYMBOL(strchr);
>  EXPORT_SYMBOL(strrchr);
>  EXPORT_SYMBOL(memset);
> +EXPORT_SYMBOL(__memset);
>  EXPORT_SYMBOL(__memset32);
>  EXPORT_SYMBOL(__memset64);
>  EXPORT_SYMBOL(memcpy);
> +EXPORT_SYMBOL(__memcpy);
>  EXPORT_SYMBOL(memmove);
> +EXPORT_SYMBOL(__memmove);
>  EXPORT_SYMBOL(memchr);
>  
>  EXPORT_SYMBOL(mmioset);


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Re: [PATCH] ARM: export __memset/__memcpy/__memmove
Posted by Florian Fainelli 3 months, 2 weeks ago

On 20/06/2025 04:12, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When KASAN is locally disabled for one file, the string functions
> get redirected to internal helpers, but those are not actually exported,
> so this only works in built-in code but fails for loadable modules:
> 
> ERROR: modpost: "__memset" [crypto/ecc.ko] undefined!
> ERROR: modpost: "__memcpy" [crypto/ecc.ko] undefined!
> 
> Add the missig exports.
> 
> Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian
Re: [PATCH] ARM: export __memset/__memcpy/__memmove
Posted by Linus Walleij 3 months, 2 weeks ago
On Fri, Jun 20, 2025 at 1:13 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> When KASAN is locally disabled for one file, the string functions
> get redirected to internal helpers, but those are not actually exported,
> so this only works in built-in code but fails for loadable modules:
>
> ERROR: modpost: "__memset" [crypto/ecc.ko] undefined!
> ERROR: modpost: "__memcpy" [crypto/ecc.ko] undefined!
>
> Add the missig exports.

missing

>
> Fixes: d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij