Skip to contentSkip to conversation

ARM: export __memset/__memcpy/__memmove

PATCH In review Arnd Bergmann 4 participants 4 messages Jun 20, 2025 – Jun 23, 2025 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: export __memset/__memcpy/__memmove

From: Arnd Bergmann <[email protected]>

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")
---
 arch/arm/kernel/armksyms.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/kernel/armksyms.c +3 -0
index 82e96ac83684..1ff50106afa4 100644
@@ -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);
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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

Quoted 3 lines
Fixes d6d51a96c7d6 ("ARM: 9014/2: Replace string mem* functions for KASan")

Yours,
Linus Walleij

Acked-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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:

Quoted 7 lines

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")
Signature · 1 line
Florian
Reviewed-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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:

Quoted 7 lines

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")
Quoted 22 lines
---
 arch/arm/kernel/armksyms.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/kernel/armksyms.c +3 -0
index 82e96ac83684..1ff50106afa4 100644
@@ -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);
Signature · 4 lines
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 |