Skip to contentSkip to conversation

next-20201105 - build issue with KASAN on ARM

PATCH In review Valdis Klētnieks 5 participants 7 messages Nov 7, 2020 – Nov 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

commit d6d51a96c7d63b7450860a3037f2d62388286a52

Author: Linus Walleij <[email protected]>
Date:   Sun Oct 25 23:52:08 2020 +0100

ARM: 9014/2: Replace string mem* functions for KASan

I'm trying to figure out why this has 3 Tested-By: tags but blows up for fairly obvious reasons on ARM.....

CC arch/arm/boot/compressed/string.o
arch/arm/boot/compressed/string.c:24:1: error: attribute 'alias' argument not a string
void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy); ^~~~
arch/arm/boot/compressed/string.c:25:1: error: attribute 'alias' argument not a string
void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove); ^~~~
arch/arm/boot/compressed/string.c:26:1: error: attribute 'alias' argument not a string
void *__memset(void *s, int c, size_t count) __alias(memset);
^~~~
make[2]: *** [scripts/Makefile.build:283: arch/arm/boot/compressed/string.o] Error 1 make[1]: *** [arch/arm/boot/Makefile:64: arch/arm/boot/compressed/vmlinux] Error 2

#1 lore raw

Hi Valdis,

Quoted 8 lines · Valdis Klētnieks

commit d6d51a96c7d63b7450860a3037f2d62388286a52

Author: Linus Walleij <[email protected]>
Date:   Sun Oct 25 23:52:08 2020 +0100

ARM: 9014/2: Replace string mem* functions for KASan

I'm trying to figure out why this has 3 Tested-By: tags but blows up for fairly obvious reasons on ARM.....

Because it builds fine if you check out Russell's branch. This build error only happens because of a treewide change in -mm that was applied after the ARM merge:

https://lore.kernel.org/linux-arm-kernel/20201106094434.GA3268933@ubuntu-m3-large-x86/

https://lore.kernel.org/linux-arm-kernel/20201106180929.GD2959494@ubuntu-m3-large-x86/

Stephen could apply that diff as a fixup for the -mm patch when he builds -next or I can send it as a formal patch for him to apply.

Quoted 4 lines

CC arch/arm/boot/compressed/string.o
arch/arm/boot/compressed/string.c:24:1: error: attribute 'alias' argument not a string
void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy); ^~~~

Quoted 9 lines

arch/arm/boot/compressed/string.c:25:1: error: attribute 'alias' argument not a string
void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove); ^~~~
arch/arm/boot/compressed/string.c:26:1: error: attribute 'alias' argument not a string
void *__memset(void *s, int c, size_t count) __alias(memset);
^~~~
make[2]: *** [scripts/Makefile.build:283: arch/arm/boot/compressed/string.o] Error 1 make[1]: *** [arch/arm/boot/Makefile:64: arch/arm/boot/compressed/vmlinux] Error 2

Cheers,
Nathan

#2 lore raw

Hi Nathan,

Quoted 11 lines · On Sat, 7 Nov 2020 13:04:53 -0700 Nathan Chancellor <[email protected]>…

Because it builds fine if you check out Russell's branch. This build error only happens because of a treewide change in -mm that was applied after the ARM merge:

https://lore.kernel.org/linux-arm-kernel/20201106094434.GA3268933@ubuntu-m3-large-x86/

https://lore.kernel.org/linux-arm-kernel/20201106180929.GD2959494@ubuntu-m3-large-x86/

Stephen could apply that diff as a fixup for the -mm patch when he builds -next or I can send it as a formal patch for him to apply.

I have applied the patch by hand today, but please send a patch to Andrew pointing out that it should go in his post -next series (or possibly he should also move treewide-remove-stringification-from-__alias-macro-definition.patch into the post -next series).

Signature · 2 lines
Cheers,
Stephen Rothwell
#3 lore raw

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi Nathan,

Quoted 9 lines · On Sat, 7 Nov 2020 13:04:53 -0700 Nathan Chancellor <[email protected]>…

Because it builds fine if you check out Russell's branch. This build error only happens because of a treewide change in -mm that was applied after the ARM merge:

https://lore.kernel.org/linux-arm-kernel/20201106094434.GA3268933@ubuntu-m3-large-x86/

https://lore.kernel.org/linux-arm-kernel/20201106180929.GD2959494@ubuntu-m3-large-x86/

Quoted 8 lines
Quoted 2 lines

Stephen could apply that diff as a fixup for the -mm patch when he builds -next or I can send it as a formal patch for him to apply.

I have applied the patch by hand today, but please send a patch to Andrew pointing out that it should go in his post -next series (or possibly he should also move treewide-remove-stringification-from-__alias-macro-definition.patch into the post -next series).

Ack, thank you for the guidance, as I am unsure how exactly contexual changes like this are supposed to be handled when dealing with a quilt series. I will send a formal patch soon.

Cheers,
Nathan

#4 lore raw

PATCH 1/1 ARM: boot: Quote aliased symbol names in string.c

Patch "treewide: Remove stringification from __alias macro definition" causes arguments to __alias to no longer be quoted automatically, which breaks CONFIG_KASAN on ARM after commit d6d51a96c7d6 ("ARM: 9014/2:
Replace string mem* functions for KASan"):

arch/arm/boot/compressed/string.c:24:1: error: attribute 'alias' argument not a string

   24 | void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy);
      | ^~~~
arch/arm/boot/compressed/string.c:25:1: error: attribute 'alias' argument not a string
   25 | void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove);
      | ^~~~
arch/arm/boot/compressed/string.c:26:1: error: attribute 'alias' argument not a string
   26 | void *__memset(void *s, int c, size_t count) __alias(memset);
      | ^~~~

make[3]: *** [scripts/Makefile.build:283: arch/arm/boot/compressed/string.o] Error 1

Quote the names like the treewide patch does so there is no more error.

---

Hi Andrew,

Stephen said I should send this along to you so that it can be applied as part of the post -next series. Please let me know if you need any more information or clarification, I tried to document it succinctly in the commit message.

Cheers,
Nathan

 arch/arm/boot/compressed/string.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/compressed/string.c +3 -3
index 8c0fa276d994..cc6198f8a348 100644
@@ -21,9 +21,9 @@
 #undef memcpy
 #undef memmove
 #undef memset
-void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy);
-void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove);
-void *__memset(void *s, int c, size_t count) __alias(memset);
+void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias("memcpy");
+void *__memmove(void *__dest, __const void *__src, size_t count) __alias("memmove");
+void *__memset(void *s, int c, size_t count) __alias("memset");
 #endif
 
 void *memcpy(void *__dest, __const void *__src, size_t __n)
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] ARM: boot: Quote aliased symbol names in string.c

Quoted 15 lines · Nathan Chancellor

Patch "treewide: Remove stringification from __alias macro definition" causes arguments to __alias to no longer be quoted automatically, which breaks CONFIG_KASAN on ARM after commit d6d51a96c7d6 ("ARM: 9014/2:
Replace string mem* functions for KASan"):

arch/arm/boot/compressed/string.c:24:1: error: attribute 'alias' argument not a string

   24 | void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy);
      | ^~~~
arch/arm/boot/compressed/string.c:25:1: error: attribute 'alias' argument not a string
   25 | void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove);
      | ^~~~
arch/arm/boot/compressed/string.c:26:1: error: attribute 'alias' argument not a string
   26 | void *__memset(void *s, int c, size_t count) __alias(memset);
      | ^~~~
Quoted 7 lines

make[3]: *** [scripts/Makefile.build:283: arch/arm/boot/compressed/string.o] Error 1

Quote the names like the treewide patch does so there is no more error.

Quoted 35 lines

---

Hi Andrew,

Stephen said I should send this along to you so that it can be applied as part of the post -next series. Please let me know if you need any more information or clarification, I tried to document it succinctly in the commit message.

Cheers,
Nathan

 arch/arm/boot/compressed/string.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/compressed/string.c +3 -4
index 8c0fa276d994..cc6198f8a348 100644
@@ -21,9 +21,9 @@
 #undef memcpy
 #undef memmove
 #undef memset
-void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy);
-void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove);
-void *__memset(void *s, int c, size_t count) __alias(memset);
+void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias("memcpy");
+void *__memmove(void *__dest, __const void *__src, size_t count) __alias("memmove");
+void *__memset(void *s, int c, size_t count) __alias("memset");
 #endif
 
 void *memcpy(void *__dest, __const void *__src, size_t __n)
--

2.29.2

Reviewed-by on v1 1/1
#6 lore raw

Re: [PATCH] ARM: boot: Quote aliased symbol names in string.c

In reply to Nathan Chancellor
Quoted 14 lines · Nathan Chancellor

Patch "treewide: Remove stringification from __alias macro definition" causes arguments to __alias to no longer be quoted automatically, which breaks CONFIG_KASAN on ARM after commit d6d51a96c7d6 ("ARM: 9014/2:
Replace string mem* functions for KASan"):

arch/arm/boot/compressed/string.c:24:1: error: attribute 'alias' argument not a string

   24 | void *__memcpy(void *__dest, __const void *__src, size_t __n) __alias(memcpy);
      | ^~~~
arch/arm/boot/compressed/string.c:25:1: error: attribute 'alias' argument not a string
   25 | void *__memmove(void *__dest, __const void *__src, size_t count) __alias(memmove);
      | ^~~~
arch/arm/boot/compressed/string.c:26:1: error: attribute 'alias' argument not a string
   26 | void *__memset(void *s, int c, size_t count) __alias(memset);
      | ^~~~
Quoted 7 lines

make[3]: *** [scripts/Makefile.build:283: arch/arm/boot/compressed/string.o] Error 1

Quote the names like the treewide patch does so there is no more error.

Quoted 6 lines

Hi Andrew,

Stephen said I should send this along to you so that it can be applied as part of the post -next series. Please let me know if you need any more information or clarification, I tried to document it succinctly in the commit message.

I wasn't even aware that there was such a thing as post-next.

Thanks,
Linus Walleij