powerpc/prom_init: Add memset as valid external symbol if CONFIG_KASAN=y
PATCH 1/1 powerpc/prom_init: Add memset as valid external symbol if CONFIG_KASAN=y
If CONFIG_KASAN=y, powerpc:allmodconfig fails to build with the following error.
Error: External symbol 'memset' referenced from prom_init.c
The problem was introduced with commit 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support"). So far, with CONFIG_KASAN=y, only __memset was accepted as valid external symbol in prom_init_check.sh. Add memset as well to fix the problem.
--- arch/powerpc/kernel/prom_init_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/prom_init_check.sh +1 -1
@@ -16,7 +16,7 @@ grep "^CONFIG_KASAN=y$" .config >/dev/null if [ $? -eq 0 ] then - MEM_FUNCS="__memcpy __memset" + MEM_FUNCS="__memcpy __memset memset" else MEM_FUNCS="memcpy memset" fi
Signature · 1 line
2.35.1
Le 19/06/2022 à 05:52, Guenter Roeck a écrit :
Quoted 9 lines
If
CONFIG_KASAN=y, powerpc:allmodconfig fails to build with the following error.Error: External symbol 'memset' referenced from
prom_init.cThe problem was introduced with commit
41b7a347bf14("powerpc: Book3S 64-bit outline-only KASAN support"). So far, withCONFIG_KASAN=y, only__memsetwas accepted as valid external symbol inprom_init_check.sh. Add memset as well to fix the problem.
No way. It is way too early to use the instrumented version of memset().
Did you try with the patch I sent ?
Thanks
Christophe
Quoted 22 lines
Fixes 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")Cc Michael Ellerman <[email protected]>Cc Daniel Axtens <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- arch/powerpc/kernel/prom_init_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/kernel/prom_init_check.sh +1
-1@@ -16,7 +16,7 @@ grep "^CONFIG_KASAN=y$" .config >/dev/null if [ $? -eq 0 ] then - MEM_FUNCS="__memcpy __memset" + MEM_FUNCS="__memcpy __memset memset" else MEM_FUNCS="memcpy memset" fi
Le 19/06/2022 à 08:45, Christophe Leroy a écrit :
Quoted 6 lines
Le 19/06/2022 à 05:52, Guenter Roeck a écrit :
Quoted 3 lines
If
CONFIG_KASAN=y, powerpc:allmodconfig fails to build with the following error.
Quoted 8 lines
Quoted 6 lines
Error: External symbol 'memset' referenced from
prom_init.cThe problem was introduced with commit
41b7a347bf14("powerpc: Book3S 64-bit outline-only KASAN support"). So far, withCONFIG_KASAN=y, only__memsetwas accepted as valid external symbol inprom_init_check.sh. Add memset as well to fix the problem.No way. It is way too early to use the instrumented version of
memset().
See commit 26deb04342e3 ("powerpc: prepare string/mem functions for KASAN") for more details
Quoted 30 lines
Did you try with the patch I sent ?
Thanks
ChristopheQuoted 22 lines
Fixes 41b7a347bf14 ("powerpc: Book3S 64-bit outline-only KASAN support")Cc Michael Ellerman <[email protected]>Cc Daniel Axtens <[email protected]>Signed-off-by Guenter Roeck <[email protected]>--- arch/powerpc/kernel/prom_init_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/kernel/prom_init_check.sh +1
-1@@ -16,7 +16,7 @@ grep "^CONFIG_KASAN=y$" .config >/dev/null if [ $? -eq 0 ] then - MEM_FUNCS="__memcpy __memset" + MEM_FUNCS="__memcpy __memset memset" else MEM_FUNCS="memcpy memset" fi