mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 05:27:07 +02:00
ARM: 9134/1: remove duplicate memcpy() definition
commiteaf6cc7165upstream. 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/202105091112.F5rmd4By-lkp@intel.com/ Fixes:d6d51a96c7("ARM: 9014/2: Replace string mem* functions for KASan") Fixes:a7f464f3db("ARM: 7001/2: Wire up support for the XZ decompressor") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6ad8bbc9d3
commit
8a6af97c31
|
|
@ -47,7 +47,10 @@ extern char * strchrnul(const char *, int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_KERNEL_XZ
|
#ifdef CONFIG_KERNEL_XZ
|
||||||
|
/* Prevent KASAN override of string helpers in decompressor */
|
||||||
|
#undef memmove
|
||||||
#define memmove memmove
|
#define memmove memmove
|
||||||
|
#undef memcpy
|
||||||
#define memcpy memcpy
|
#define memcpy memcpy
|
||||||
#include "../../../../lib/decompress_unxz.c"
|
#include "../../../../lib/decompress_unxz.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user