Skip to content

Commit eaf6cc7

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9134/1: remove duplicate memcpy() definition
Both the decompressor code and the kasan logic try to override the memcpy() and memmove() definitions, which leading to a clash in a KASAN-enabled kernel with XZ decompression: arch/arm/boot/compressed/decompress.c:50:9: error: 'memmove' macro redefined [-Werror,-Wmacro-redefined] #define memmove memmove ^ arch/arm/include/asm/string.h:59:9: note: previous definition is here #define memmove(dst, src, len) __memmove(dst, src, len) ^ arch/arm/boot/compressed/decompress.c:51:9: error: 'memcpy' macro redefined [-Werror,-Wmacro-redefined] #define memcpy memcpy ^ arch/arm/include/asm/string.h:58:9: note: previous definition is here #define memcpy(dst, src, len) __memcpy(dst, src, len) ^ Here we want the set of functions from the decompressor, so undefine the other macros before the override. Link: https://lore.kernel.org/linux-arm-kernel/CACRpkdZYJogU_SN3H9oeVq=zJkRgRT1gDz3xp59gdqWXxw-B=w@mail.gmail.com/ Link: https://lore.kernel.org/lkml/[email protected]/ Fixes: d6d51a9 ("ARM: 9014/2: Replace string mem* functions for KASan") Fixes: a7f464f ("ARM: 7001/2: Wire up support for the XZ decompressor") Reported-by: kernel test robot <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent e6a0c95 commit eaf6cc7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm/boot/compressed/decompress.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ extern char * strchrnul(const char *, int);
4747
#endif
4848

4949
#ifdef CONFIG_KERNEL_XZ
50+
/* Prevent KASAN override of string helpers in decompressor */
51+
#undef memmove
5052
#define memmove memmove
53+
#undef memcpy
5154
#define memcpy memcpy
5255
#include "../../../../lib/decompress_unxz.c"
5356
#endif

0 commit comments

Comments
 (0)